Wednesday, September 7, 2011

How to Setup FTP and an anonymous FTP server with vsftpd with upload enable

Setup vsftpd in CentOS
yum install vsftpd
chkconfig vsftpd on
service vsftpd start
cp /etc/vsftpd/vsftpd.conf /etc/vsftpd/vsftpd.conf.original
anonymous_enable=NO
listen=YES
local_enable=NO
anonymous_enable=YES
write_enable=NO
anon_root=/var/ftp
anon_max_rate=2048000
xferlog_enable=YES 


   
 
 
 
Setup Anonymous FTP with upload enable
#
vim /etc/vsftpd/vsftpd.conf
anon_root=/myftpDir/pub
listen_port=21
listen=YES
local_enable=YES
anonymous_enable=YES
write_enable=YES
anon_max_rate=2048000
xferlog_enable=YES
ftp_username=ftp
anon_upload_enable=YES
anon_mkdir_write_enable=YES
#anon_other_write_enable=YES
anon_world_readable_only=NO
ftpd_banner=(All Activities are monitored on this system!!)
log_ftp_protocol=YES
no_anon_password=YES
local_umask=022

save & exit by :wq

Now
Make sure that root directory  is not  being writable
The ftp root directory MUST NOT be owned by ftp for security reasons (it should be root:root).

Change the permission as below:
chmod u-w /myftpDir/pub
mkdir /myftpDir/pub/upload
chown u-w /myftpDir/pub/upload






Monday, September 5, 2011

SAMBA


yum -y install samba samba-client
service smb start
chkconfig smb on
mkdir /data
mkdir /data/share
chmod 766 /data/share
mv /etc/samba/smb.conf /etc/samba/smb.conf.backup
vim /etc/samba/smb.conf
 
Samba Config - smb.conf
[global]
workgroup = workgroup
netbios name = abc
security = SHARE
load printers = No
default service = global
path = /data
available = No
encrypt passwords = yes

guest account = nobody
[ShareLocation]
guest ok = yes
guest only = yes
path = /ShareLocation
read only = yes
browseable = yes
save and exit by :wq
============================