Blogger Information
Blog 12
fans 1
comment 1
visits 19005
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
Linux下的vsftpd设置
黄小凡的博客
Original
945 people have browsed it

 1、首先查看有没有安装vsftpd

        rpm -qa | grep vsftpd


  2、用yum方式安装vsftpd

        yum install vsftpd

  3、安装完成后,设置开始自动启动

        chkconfig vsftpd on

        service vsftpd start

  4、查看ftp端口是否在侦听了

        netstat -tl

  5、配置vsftpd.conf

        /etc/vsftpd/ftpusers 和 /etc/vsftpd/user_list,#不能登陆FTP的用户

        配置:/etc/vsftpd/vsftpd.conf

        将anonymous_enable=YES改为# anonymous_enable=YES 并在下面新加一行:

        anonymous_enable=NO //不允许匿名用户访问

        将# chroot_local_user=YES改为chroot_local_user=YES //表示把FTP用户都限制在家目录

        中

  6、设置FTP目录

  mkdir /home/ftproot //创建FTP目录

        chmod -R 777 /home/ftproot //递归地给此目录下所有文件和子目录的读、写、执行权限

        chgrp -R ftp /home/ftproot //递归地把此目录及该目录下所有文件和子目录的组属性成ftp组

  7、增加FTP用户

        adduser -d /home/ftproot -g ftp -s /sbin/nologin user //增加用户,组是FTP,目录>是/home/ftproot

        passwd user //为FTP用户设定密码

  8、重启vsftpd

        service vsftpd restart

  9、FTP用户管理

        userdel 选项 用户名 #删除用户

常用的选项是-r,它的作用是把用户的主目录一起删除。

passwd 选项 用户名 #修改口令

passwd -l 用户名 锁定口令,即禁用账号。

passwd -u 用户名 口令解锁。

passwd -d 用户名 使账号无口令。

passwd -f 用户名 强迫用户下次登录时修改口令。

如果默认用户名,则修改当前用户的口令。

如果是超级用户,可以用下列形式指定任何用户的口令:

passwd 用户名

passwd -d 用户名 此命令将用户的口令删除,这样用户下一次登录时,系统就不再询问口

10、修改默认21端口

先修改防火墙,增加其FTP端口,下面使用211

-A RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 211 -j ACCEPT

service iptables restart

/etc/vsftpd/vsftpd.conf 里增加加 listen_port=211

service vsftpd restart

netstat -an | grep 211 //查看端口是否正常启动

这个总结的比较详细,并且很多步骤常用命令都写上了。思路很清晰。


Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!