How can I restrict FTP users to specific folders on server?

Hi all,

I have centOS 6 installed on our Linode VPS server.

I have successfully installed FTP and created an FTP user.

However, the FTP user can view all the files on the server.

How can I restrict the FTP user to the files in a directory?

Currently, the user is sent straight to var/www/html (but this FTP user is able to view the other files on the server)

but I have created virtual hosts on the server and this FTP user should actually go to

/var/www/vhosts/mywebsite.com/httpdocs

And not be able to view the other files…

How can I achieve this?

(Here’s how I got to this point: I had added the user by doing: useradd -d /var/www/vhosts/mywebsite.com/httpdocs myftpuser

And then created and added myftpuser to /etc/vsftpd/chroot_list )

Thanks.

2 Replies

Look into the chroot options to control where a user is restricted to after login, and if desired, combine that with per user configuration files (via userconfigdir) to set local_root individually per user.

– David

Thanks @db31

would try it out…

Thanks a lot.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct