4

I'm kind of new with Linux Ubuntu. I followed this guide.

My user: jer is still able to see files by going back from his directory and open stuff and copy things. The thing that I found good is that he can't delete, edit or add rather than his own directory(which was before bugged but then I added Owner:jer from Winscp to that folder).

I want jer not able to view anything else than his folder! As jer could open other secret files and copy data.

13
  • Did you set the option chroot_local_user=YES in /etc/vsftpd.conf and restarted the process afterwards?
    – Nephente
    Sep 16, 2015 at 10:36
  • Yes I did that, I set chroot_local_user=YES and then restarted the process but service vsftpd restart. Here is my config file: pastebin.com/S1tf1X6r Sep 16, 2015 at 11:00
  • Strange. I just tried it with vsftpd version 3.0.2. Set local_enable=YES; chroot_local_user=YES; allow_writable_chroot=YES. I can log in with a local user account and the server jails me to my homedirectory, as it should.
    – Nephente
    Sep 16, 2015 at 12:01
  • I'm too in my home directory, but what the problem is, I can see other directories too. Which I don't want to happen. Sep 16, 2015 at 12:08
  • You mean you can browse out of your home dir and view the content of /home?
    – Nephente
    Sep 16, 2015 at 12:10

1 Answer 1

3

The manual:

https://www.krizna.com/ubuntu/setup-ftp-server-on-ubuntu-14-04-vsftpd/

Setup FTP server on Ubuntu 14.04

Step 1 » Update repositories.

$ sudo apt-get update

Step 2 » Install VsFTPD package using the below command.

$ sudo apt-get install vsftpd

Step 3 » After installation open /etc/vsftpd.conf file and make changes as follows.

»Uncomment the below lines (line no:29 and 33).

write_enable=YES
local_umask=022

» Uncomment the below line (line no: 120 ) to prevent access to the other folders outside the Home directory.

chroot_local_user=YES

and add the following line at the end.

allow_writeable_chroot=YES

» Add the following lines to enable passive mode.

pasv_enable=Yes
pasv_min_port=40000
pasv_max_port=40100

Step 4 » Restart vsftpd service using the below command.

$ sudo service vsftpd restart

Step 5 » Now ftp server will listen on port 21. Create user with the below command.

Use /usr/sbin/nologin shell to prevent access to the bash shell for the ftp users .

$ sudo useradd -m john -s /usr/sbin/nologin
$ sudo passwd john

Step 6 » Allow login access for nologin shell . Open /etc/shells and add the following line at the end.

/usr/sbin/nologin

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .