FTP Server
Server
configuration:-
Anonmyous user
(for upload).
- Package installed yum install vsftpd* -y
- Vim /etc/vsftpd/vsftpd.config (make entry)
Line no.27 and 31 make a uncomment. For uncomment removed (#)hash.
#27 no.= anon_upload_enable=yes
#31 no.=anon_mkdir_write_enable=yes
- Save & exit.
- Service vsftpd restart
- Chkconfig vsftpd on
- Getsebool -a | grep ftp (to check ftp permission level)
- Man ftpd_selinux (see ftpd manual page by thiazcvs command)
- Setsebool -P allow_ftpd_anon_write on (set selinux permission level & booliance of selinux)
- Chcon –R –t public_content_rw_t /var/ftp/pub/ (set to read & write permission , level & content)
- ls –lZd /var/ftp/pub/ (to cross check permission setting )
- chmod 777 –R /var/ftp/pub/ (set to ftp full permission)
Client side configuration:-
ftp 192.168.0.12 (server ip)
(connect to the server by ftp)
put post.log (file transfering
one system to another system)
# Assign new directory to
Anonmyous user. (download)
- Lcd ( use this command to specified path)
- Mkdir –p /anon/anondir (create a directory to the name of /anon/anondir)
- Vim /etc/vsftpd/vsftpd.conf (make some changes in vsftpd file)
- Allow anonymous FTP? (Beware - allowed by default if you comment this out)
anonymous_enable=YES
anon_root=/anon (to set
permission to access directory)
- Service vsftpd restart
- ls –lZd /anon/anondir/
- chcon –R –t public_content_rw_t /anon/anondir/ (to set read & write permission)
- ls –lZd /anon/anondir/ (cross check by this command)
- getsebool –a |grep ftp
showing like this:-
ftp_home_dir --> of (on this directory by below command)
setsebool –P
ftp_home_dir --> on (Hit enter key)
#
Upload from New directory
- Vim /etc/vsftpd/vsftpd.conf
- #27 no.= anon_upload_enable=yes
#31 no.= anon_write_enable=yes
Local_enable=yes (make uncomment this line)
- Chcon –R –t public_content_rw_t /anon/anondir ( set content level or say that permission to read & write)
- Getsebool –a |grep ftp ( to check status it’s showning on or not)
- Chmod 777 /anon/anondir (set full permission to access)
# user level access (FTP)
(Assign new directory to local users)
- Mkdir /data - 1st create a new directory
- Vim /etc/vsftpd/vsftpd.conf
- Uncomment a line given below to access a local users
# Local_enable=yes
#
Local_root=/data
- Service vsftpd restart ssss
- Chcon –R –t user_home_dir_rw_t /data (set content to home directory to read & write permission )
- Getsebool –a |grep ftp (see to check status of permission,it’s on or off)
- Setsebool –P user_home_dir on
- Chmod 777 –R /data (set full permission to access /data directory)
# Root level access
- Cd /etc/vsftpd (1st change working directory by cd command)
- Vim ftpusers ( enter in edit mode)
- #root (superuser) make a comments with #(hash) to root & set to access ftp by root.
- Vim user_list (make some change by edit mode)
- #root make a comments with # to superuser for login by root.
- Service vsftpd restart or /etc/init.d/vsftpd restart use to restart services by this cmd .
No comments:
Post a Comment