1

The directories and the access setting is like below.

/home/directoroy1
rwxr-xr-x 4 user1 user1 4096

/home
rwxrwxr-x 5 root root 4096

And in vsftpd.conf, I set like below.

chroot_local_user=YES
allow_writeable_chroot=YES

And then restart vsftpd as below.

systemctl restart vsftpd

However whenever I test with Filezilla with the ID user1, firstly it goes to it's designated directory /home/directory1, but I can still see .. and able to click it to see upper directory. I can even go see every other directory including root directory, with user1. Where did I do wrong?

1 Answer 1

1

It turns out that my problem was SFTP. When using SFTP, vsftpd.conf setting does not work, and user can go up tp upper directory. So I did the followings: (1) Change /etc/ssh/sshd_config --> Add the following:

 Match User user1 
  ChrootDirectory /home/directory1
  ForceCommand internal-sftp 
  AllowTcpForwarding no

(2) Set the directories as below:

/home
rwxr-xr-x root root

/home/directory1
rwxr-xr-x root root

(3) Add one more directory under /home/user1

/home/directory1/data
rwx------ user1 user1

Then user1's home directory was set as /home/directory1 and user1 could not go to upper directory as I wished. And user1 was able to upload files on /home/directory1/data.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.