Printable Version of Topic

Click here to view this topic in its original format

Linuxhelp _ Guides Forum _ CentOS 3.x, 4.x VSFTPD Ftp server

Posted by: Robert83 Jan 16 2006, 03:02 AM

Hello Everyone,

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


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


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


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


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

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)