Summer Nights

A blog on embedded and real-time systems as well as on general computing issues

Share Data using FTP Server

First create an appropriate user, with no shell access, belonging to ftp-users group and chrooted jail at /srv/ftp/xxxx:

useradd ftp-userxx -G ftp-users -s /bin/false -d /srv/ftp/xxxx

Now assign a password to the user, and make it the owner of the shared folder:
passwd ftp-userxx
chown -R ftp-userxx /srv/ftp/xxxx

Now copy the files to be shared into the respective folder. After that change the permissions to read-only. Be careful! we need +x in order to be able to do chroot:
chmod -R 544 /srv/ftp/xxxx

Assuming we are doing it using proftp, the following should be given:

  • proftpd running
  • Port 21 open
  • In /etc/proftpd/proftpd.conf file: RequireValidShell off
  • And to keep the users in the chrooted jail: DefaultRoot ~

Leave a Reply

Your email address will not be published. Required fields are marked *