1.安装vsftpd
sudo apt-get install vsftpd
2.配置vsftpd
sudo nano /etc/vsftpd.conf
# Run standalone? vsftpd can run either from an inetd or as a standalone
# daemon started from an initscript.
listen=YES #将NO改为YES
#
# This directive enables listening on IPv6 sockets. By default, listening
# on the IPv6 "any" address (::) will accept connections from both IPv6
# and IPv4 clients. It is not necessary to listen on *both* IPv4 and IPv6
# sockets. If you want that (perhaps because you want to listen on specific
# addresses) then you must run two copies of vsftpd with two configuration
# files.
listen_ipv6=NO #将YES改为NO
#
3.添加用户名和用户组(可不做)
# groupadd ftpuser
# mkdir /home/tom/
# useradd -g ftpuser tom
给用户设置密码
# passwrd tom
输入两次密码
4.修改权限
sudo nano /etc/passwd
最后面是权限
tom:x:1001:1001::/home/tom:
增加/bin/bash
tom:x:1001:1001::/home/tom:/bin/bash
更改文件所有者权限
#chown -v -R tom:ftpuser /home/tom/
#chmod -v -R 700 /home/tom/
5.重启vsftpd
sudo service vsftpd restart
使用FileZilla时
linux ip+用户明+密码即可
可能错误
上传文件:
ftp> mput db.iso
550 Permission denied
原因:vsftp默认配置不允许上传文件。
解决:修改/etc/vsftpd.conf
将“write_enable=YES”前面的#取消。
重启vsftp服务器。