Centos – How to add a new user to vsftpd and let root access the FTP server

centosftpvsftpd

How can I add a new vsftpd user on CentOS 5 ? I would like that user to default to a certain directory other than its own. Note that chroot is on. Should I do something like this?

useradd vsftpuser1 -d /home/mainaccount
passwd vsftpuser1

Do I have to edit anything in vsftpd or is this it?

Also, in /etc/vsftpd.ftpusers it has root in with a group of users that are not allowed to login via ftp . If I remove root from this, will root be able to sftp in without chroot restrictions? Is there any threat to my system by let root in in this manner?

Best Answer

Follow the manual for adding new users. That's why they are written.

You won't allow root to access the FTP server! This is the highest security risk you can expose your host to. FTP transmits the password in clear text over the wire. Everybody having access to the network can easily sniff the password. Having the password you give everybody full control over your server! In other words: Don't do that!!

SFTP is another protocol and has nothing to do with FTP beside the name. A protocol related to FTP is FTPS which is nothing else than FTP over SSL. SFTP is something like FTP alternative over SSH.