Setting up vsftpd in Ubuntu server
sudo apt-get Install VSFTPD
Build FTP in order to log on users, can not view other directories, can only operate files in their own directory, and can not login SSH
1. Add Users: Pinkrose
The command format is: sudo useradd user name-D user's login directory-S login time Shell
sudo useradd pinkrose-d/home/pinkrose-s/bin/false
One small step to do: we can go into the/etc directory of sudo vim passwd to see a bit of user information for the pinkrose I just created
PINKROSE:X:1009:1009::/home/pinkrose:/bin/false
2. Add a password to the Pinkrose user
sudo passwd pinkrose
To enter the password two times, you can successfully set the user's password, such as:
Go to the/etc directory and edit the VSFTPD configuration file vsftpd.conf
The configuration files that I modified are:
listen=yesanonymous_enable=nolocal_enable=yeswrite_enable=yesanon_upload_enable =yesanon_mkdir_write_enable=yesdirmessage_enable=yesuse_localtime= Yesconnect_from_port_20=YES
#I changechroot_local_user=yeschroot_list_enable=nochroot_list_file=/etc/ Vsftpd.chroot_listsecure_chroot_dir=/var/run/vsftpd/Empty#wakasann Add configlocal_root =/var/www
Then press the ESC key and enter ": Wq" to save and exit vim
Create a Chroot_list_file file,
sudo vim/etc/vsftpd.chroot_list
After opening, enter the user name that you just added: Pinkrose, one row for a user name
Once added, you can restart the VSFTPD service.
sudo service vsftpd restart
Then we use the FTP tool to try to log in to FTP
Login may be reported as:
1.530 Login Incorrect
192.168. 1.147 , ip=192.168. 1.147 port=192.168. 1.147 2.3. 5 331530 Login incorrect.[ Right] Connection failed
The workaround is to:
sudo apt-get/etc/pam.d/vsftpdsudo apt-get install VSFTPD
2. Login prompt: vsftpd Connection connect Time Out
My workaround is: Open port 21
Reference:
1. Create an FTP user under Ubuntu who only accesses content in a specific directory
2. Linux Add Users, permissions
3. VSFTPD Lock User Directory [Ubuntu, FTP server, vsftpd.conf]
4. http://www.lylinux.org/ubuntu-12-04-server-installation-the-vsftpd-tips-530-login-incorrect.html
Ubuntu Server build VSFTPD Small note