1.更換國內源;
2.刷新源:sudo apt-get update
3.sudo apt-get install vsftpd
4.新建"/home/uftp"目錄作為用戶主目錄打開"終端窗口",輸入"sudo mkdir /home/uftp"-->回車-->輸入"sudo ls /home"-->回車-->有一個uftp目錄,目錄新建成功。
5.新建用戶uftp並設置密碼打開"終端窗口",輸入"sudo useradd -d /home/uftp -s /bin/bash uftp"-->回車-->用戶新建成功-->輸入"sudo passwd uftp"設置uftp用戶的密碼-->回車-->輸入兩次密碼-->回車-->密碼設置成功。
6.使用gedit修改配置文件/etc/vsftpd.conf打開"終端窗口",輸入"sudo gedit /etc/vsftpd.conf"-->回車-->打開了vsftpd.conf文件,向文件中添加"userlist_deny=NO userlist_enable=YES userlist_file=/etc/allowed_users"和"seccomp_sandbox=NO"-->使文件中的"local_enable=YES"-->保存。


7.使用gedit新建/etc/allowed_users文件打開"終端窗口",輸入"sudo gedit /etc/allowed_users"-->回車-->輸入uftp-->保存, 文件創建成功。
8.使用gedit查看/etc/ftpusers文件中的內容打開"終端窗口",輸入"sudo gedit /etc/ftpusers"-->回車-->打開這個文件后,看一看有沒有uftp這個用戶名,如果沒有,就直接退出。如果有就刪除uftp,因為這個文件中記錄的是不能訪問FTP服務器的用戶清單。(去掉root)
9.任意客戶端登陸。
安裝vsftpd提示530 Login incorrect
今天想在我的電腦上面使用虛擬機測試wordpress,所以想使用vsftpd來搭建一個ftp服務器,方便文件傳輸,安裝好之后修改配置文件為允許本地用戶登錄,禁止匿名用戶登錄
anonymous_enable=NO
Uncomment this to allow local users to log in.
local_enable=YES
Uncomment this to enable any form of FTP write command.
write_enable=YES
但是使用ftp 命令登陸的時候總是提示如下的錯誤
root@server:~# ftp localhost
Connected to localhost.
220 (vsFTPd 2.3.5)
Name (localhost:root): ubuntu
331 Please specify the password.
Password:
530 Login incorrect.
Login failed.
ftp> 221 Goodbye.
於是我在網上搜了下看看大家都是怎么解決的,最后終於找到了解決的辦法
sudo apt-get remove vsftpd
sudo rm /etc/pam.d/vsftpd
sudo apt-get install vsftpd
這是因為ubuntu啟用了PAM,所在用到vsftp時需要用到 /etc/pam.d/vsftpd 這個文件(默認源碼安裝的不會有這個文件),因此除了匿名用戶外本地用戶無法登錄。所以只要刪除了就可以了。
