lundi 23 mars 2015

Restrict FTP user to access only its own directory and Download Only


I need to create a user which can only FTP to specific directory and download data from it only no upload or delete files.


After searching on line I reached to following points



  1. useradd -g 10 -d /data/ -m -s /bin/bash myftp

  2. Run ftpconfig -d /data/


  3. in /etc/ftpd/ftpaccess update as below:


    guestuser myftp




  4. update /etc/ftpd/ftpaccess as below:


    delete no anonymous,guest


    upload class=guestuser * /data/ no myftp staff nodirs



  5. Run "in.ftpd -a"


But i saw following directories got created in user folder, Please suggest any better alternatives



d--x--x--x 2 root sys 512 Mar 23 12:52 dev
d--x--x--x 5 root sys 512 Mar 23 12:52 etc
lrwxrwxrwx 1 root bin 9 Mar 23 12:52 bin -> ./usr/bin
d--x--x--x 2 root bin 512 Mar 23 12:52 lib
d--x--x--x 6 root sys 512 Mar 23 12:52 usr
drwxr-xr-x 2 root sys 512 Mar 23 12:52 pub


Aucun commentaire:

Enregistrer un commentaire