AWS: Mount S3 Bucket to an EC2 instance. (Later FTP Tunneling)

Timo picture Timo · Jan 5, 2017 · Viewed 29.7k times · Source

what do I want to do?

Step1: Mount a S3 Bucket to an EC2 Instance.

Step2: Install a FTP Server on the EC2 Instance and tunnel ftp-requests to files in the bucket.

What did I do so far?

  • create bucket
  • create security group with open input ports (FTP:20,21 - SSH:22 - some more)
  • connect to ec2

And the following code:

wget https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/s3fs/s3fs-1.74.tar.gz
tar -xvzf s3fs-1.74.tar.gz
yum update all
yum install gcc libstdc++-devel gcc-c++ fuse fuse-devel curl-devel libxml2-devel openssl-devel mailcap
cd s3fs-1.74
./configure  --prefix=/usr
make
make install
vi /etc/passwd-s3fs # set access:secret keys
chmod 640 /etc/passwd-s3fs
mkdir /s3bucket
cd /s3bucket

And cd anwers: Transport endpoint is not connected

Dunno what's wrong. Maybe I am using the wrong user? But currently I only have one user (for test reasons) except for root.

Next step would be the ftp tunnel, but for now I'd like getting this to work.

Answer

Timo picture Timo · Jan 5, 2017

I followed these instructions now. https://github.com/s3fs-fuse/s3fs-fuse

I guess they are calling the API in background too, but it works as I wished.