How to give a user global FTP privileges (with vsftpd)
This guide applies to CentOS (a generic version of Red Hat Enterprise Linux, or RHEL) and vsftpd.
There's actually not much reason to give a Linux user FTP access to your entire server; each user can access its own directory, which is fine for user mywebsite. But this can be useful for an admin to create a generic FTP user, with a different username and password from any users with sudo to root capabilities.
cd etc
sudo vi vsftpd/vsftpd.conf
In /etc/vsftpd/vsftpd.conf, uncomment these lines (press i
to enter insert/edit mode):
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd.chroot_list
So that the relevant section looks like:
# You may specify an explicit list of local users to chroot() to their home
chroot_local_user=YES
# users to NOT chroot().
chroot_list_enable=YES
# (default follows)
chroot_list_file=/etc/vsftpd.chroot_list
(Press esc
to exit edit mode and Shift-ZZ to save and quit Vim.)
Then,
sudo vi vsftpd.chroot_list
And type in the user or users (one per line) you want to break out of the chroot jail and give global FTP to.
And don't forget:
sudo /etc/init.d/vsftpd restart
(Changes to vsftpd.chroot_list will take affect without restarting vsftpd, but a restart after editing vsftpd.conf is required.)
This guide applies to CentOS (a generic version of Red Hat Enterprise Linux, or RHEL) and vsftpd.
There's actually not much reason to give a Linux user FTP access to your entire server; each user can access its own directory, which is fine for user mywebsite. But this can be useful for an admin to create a generic FTP user, with a different username and password from any users with sudo to root capabilities.
cd etc
sudo vi vsftpd/vsftpd.conf
In /etc/vsftpd/vsftpd.conf, uncomment these lines (press i
to enter insert/edit mode):
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd.chroot_list
So that the relevant section looks like:
# You may specify an explicit list of local users to chroot() to their home
chroot_local_user=YES
# users to NOT chroot().
chroot_list_enable=YES
# (default follows)
chroot_list_file=/etc/vsftpd.chroot_list
(Press esc
to exit edit mode and Shift-ZZ to save and quit Vim.)
Then,
sudo vi vsftpd.chroot_list
And type in the user or users (one per line) you want to break out of the chroot jail and give global FTP to.
And don't forget:
sudo /etc/init.d/vsftpd restart
(Changes to vsftpd.chroot_list will take affect without restarting vsftpd, but a restart after editing vsftpd.conf is required.)
Comments
Post new comment