转自:http://chaos.blog.51cto.com/415914/470503
1、安装vsftp,本文采用yum安装:
#yum install vsftpd2、安装后运行:
# service vsftpd restartShutting down vsftpd: [ OK ]Starting vsftpd for vsftpd: [ OK ]3、新增加系统用户:
#useradd -d /home/chaosdir -s /sbin/nologin chaos //增加新用户不让在本机登陆#chown -R chaos /home/chaosdir //更改新增目录的权限,只允许chaos访问此目录;#chmod 777 -R /home/chaosdir# passwd chaos //为用户设置密码;Changing password for user chaos.New UNIX password:BAD PASSWORD: it does not contain enough DIFFERENT charactersRetype new UNIX password:passwd: all authentication tokens updated successfully.5、修改vsftpd.conf 禁止匿名帐号登陆及允许自建帐号登陆:
#vi /etc/vsftpd/vsftpd.conf
anonymous_enable=NOlocal_enable=YESwrite_enable=YESlocal_umask=022dirmessage_enable=YESxferlog_enable=YESconnect_from_port_20=YESxferlog_std_format=YESchroot_list_enable=YESchroot_list_file=/etc/vsftpd/chroot_listlisten=YESpam_service_name=vsftpduserlist_enable=YEStcp_wrappers=YES4、修改/etc/vsftpd/chroot_list 添加chaos 帐号允许该帐号登陆FTP服务器
5、在linux Shell 命令模式下
#setsebool ftpd_disable_trans 1 // 关闭掉Selinux 对ftp服务的保护;#vi /etc/selinux/configSELINUX=disabled //将此处设置为Disable# SELINUXTYPE= type of policy in use. Possible values are:# targeted – Only targeted network daemons are protected.# strict – Full SELinux protection.SELINUXTYPE=targeted重启服务
# service vsftpd restartShutting down vsftpd: [ OK ]Starting vsftpd for vsftpd: [ OK ]
评论