|
|
Posted on 1/11/2016 2:59:51 PM
|
|
|

Table of contents:
1. Install vsftp software on Redhat/CentOS
2. Install vsftp software on Ubuntu/Debian
1. Install vsftp software on Redhat/CentOS
1. Update the yum source
First of all, you need to update the yum source of the system, and the convenient tool download address: http://help.aliyun.com/manual?spm=0.0.0.0.zJ3dBU&helpId=1692
2. Install vsftp
Use the yum command to install vsftp
#yum install vsftpd -y
3. Add the FTP account and directory
Check the location of the nologin first, usually under /usr/sbin/nologin or /sbin/nologin.
Create an account using the following command, which specifies /alidata/www/wwwroot as the home directory of the user pwftp, and you can define the account name and directory yourself:
#useradd -d /alidata/www/wwwroot -s /sbin/nologin pwftp
To change the password for the account:
#passwd pwftp
Modify permissions for a specified directory
#chown -R pwftp.pwftp /alidata/www/wwwroot
4. Configure vsftp
Edit the vsftp configuration file with the following command:
#vi /etc/vsftpd/vsftpd.conf
Replace "anonymous_enable=YES" with "anonymous_enable=NO" in the configuration file
Remove the comment symbol before the following configuration:
local_enable=YES
write_enable=YES
chroot_local_user=YES
Save the modification, press the ESC key, and enter: wq
5. Modify the shell configuration
viEdit /etc/shells, and add /usr/sbin/nologin or /sbin/nologin (depending on the current system configuration) in the file
6. Start the vsftp service and test login
Start the vsftp service with the command:
#service vsftpd start
Then use the account pwftp to test whether you can log in to FTP. The directory is /alidata/www/wwwroot.
2. Install vsftp software on Ubuntu/Debian
1. Update the software source
First of all, you need to update the software source of the system, and the convenient tool download address: http://help.aliyun.com/manual?spm=0.0.0.0.zJ3dBU&helpId=1692
2. Install vsftp
Install vsftp using the apt-get command
#apt-get install vsftpd -y
3. Add the FTP account and directory
Check the location of the nologin first, usually under /usr/sbin/nologin or /sbin/nologin.
Create an account using the following command, which specifies /alidata/www/wwwroot as the home directory of the user pwftp, and you can define the account name and directory yourself:
#useradd -d /alidata/www/wwwroot -s /sbin/nologin pwftp
To change the password for the account:
#passwd pwftp
Modify permissions for a specified directory
#chown -R pwftp.pwftp /alidata/www/wwwroot
4. Configure vsftp
Edit the vsftp configuration file with the following command:
#vi /etc/vsftpd.conf
Replace "anonymous_enable=YES" with "anonymous_enable=NO" in the configuration file
Remove the comment symbol before the following configuration:
local_enable=YES
write_enable=YES
chroot_local_user=YES
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd.chroot_list
Save to exit
Edit the /etc/ vsftpd.chroot_list file, add the FTP account name, and save the exit
5. Modify the shell configuration
viEdit /etc/shells, and add /usr/sbin/nologin or /sbin/nologin (depending on the current system configuration) in the file
6. Restart the vsftp service and test login
Start the vsftp service with the command:
#service vsftpd restart
Then use the account pwftp to test whether you can log in to FTP. The directory is /alidata/www/wwwroot. |
Previous:vsftpd to add new usersNext:Ctrip is in hand, and you can't leave.
|