This one is going to be a CentOS 3.x,CentOS 4.x vsftpd guide.
First you need to download CentOS 3.x CD1 or CentOS 4.x CD1 from www.centos.org.
Then once the computer is installed you do the
CODE
yum update
Once the update has successfully finished, you issue the following command
CODE
yum install vsftpd
Using your favorite text editor or using vi (your choice) you create a new vsftpd.conf file.
First you backup the old one like this.
CODE
cd /etc/vsftpd
mkdir backup
mv vsftd.conf backup/vsftpd.conf
vi vsftpd.conf
mkdir backup
mv vsftd.conf backup/vsftpd.conf
vi vsftpd.conf
and add the following lines to the vsftpd.conf file
CODE
chown_uploads=NO
xferlog_enable=YES
idle_session_timeout=600
data_connection_timeout=120
ascii_upload_enable=NO
ascii_download_enable=NO
background=YES
listen=YES
ls_recurse_enable=NO
chroot_local_user=YES
write_enable=YES
anonymous_enable=NO
anon_upload_enable=NO
anon_mkdir_write_enable=NO
userlist_enable=YES
userlist_deny=YES
local_enable=YES
pam_service_name=vsftpd
xferlog_enable=YES
idle_session_timeout=600
data_connection_timeout=120
ascii_upload_enable=NO
ascii_download_enable=NO
background=YES
listen=YES
ls_recurse_enable=NO
chroot_local_user=YES
write_enable=YES
anonymous_enable=NO
anon_upload_enable=NO
anon_mkdir_write_enable=NO
userlist_enable=YES
userlist_deny=YES
local_enable=YES
pam_service_name=vsftpd
the file vsftpd.user_list should contain atleast the following users
root,bin,daemon,adm,lp,sync,shutdown,halt,mail,news,uucp,operator,games,nobody ...
you may need to manually add some users if you install new services for example squid , etc...
next comes the add user part
CODE
useradd myftpusername
passwd myftpusername
passwd myftpusername
then using your favorite text editor or with vi edit your /etc/passwd file like this
WRONG:
CODE
myftpusername:x:501:501::/home/myftpusername:/bin/bash
CORRECT
CODE
myftpusername:x:501:501::/home/myftpusername:/sbin/nologin
You will need to do this for each user you add and wish to use to access the ftp server.
Now all that is left, make sure vsftpd starts up by default
CODE
chkconfig vsftpd on
/etc/init.d/vsftpd start
/etc/init.d/vsftpd start
Login with your test username , and that is all.
NOTE : each user will only be able to see it's own /home/username directory , and wont be able to get outside of that.
Sincerely
Robert B