Mount an FTP directory on Linux

Skip to main content
Du bist hier:
Drucken

Mount an FTP directory on Linux

On your own server, you can easily mount FTP storage.

To mount the cloud storage without problems, you first need to install the curlftpfs package:

Debian / Ubuntu:

apt-get install curlftpfs

 

CentOS, Fedora, openSUSE:

yum install curlftpfs

 

Next, create a local directory into which you want to mount the FTP storage.

mkdir /mnt/ftpshare

 

To store the FTP credentials securely, now create the file /root/.netrc.

touch /root/.netrc

 

Now fill the file with the following content (use vi or nano via SSH, or an editor via SFTP):

 

machine srXX.firestorm.ch (hostname or IP)
login web00 (FTP username)
password 12345 (FTP password)

 

Now give the file only the minimum permissions, so that it cannot be read by unauthorised users:

chmod 600 /root/.netrc

 

Next, add the following line at the end of the file /etc/fstab (use the hostname and directory you set in the previous steps):

curlftpfs#srXX.firestorm.ch /mnt/ftpshare fuse allow_other,uid=1000,gid=1000,umask=0022 0 0

As a last step, run the following command to activate the changes:

mount -a

 

Related Post