A server installation and configuration
1. Install vsftpd. (Su where the switch to the authority. Other users use sudo permission, permission to see the previous sudo no tutorial installation)
apt-get install vsftpd
2. Configure vsftpd
we /etc/vsftpd.conf
Specific configuration is (do not copy, pure hand to play, it is inevitable error):
listen= YES
#listen_ipv6=YES
anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
anon_upload_enable=YES
anon_mkdir_write_enable=YES
dirmassage_enable=YES
user_localtime=YES
xferlog_enable=YES
connect_from_port_20=YES
chroot_local_user=YES
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd.chroot_list
secure_chroot_dir=/var/run/vsftpd/empty
pam_service_name=vsftpd
rsa_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
ssl_enable=NO
# Newly added
userlist_file=/etc/vsftpd.user_list
local_root = / home / xxx #xxx new ftp directory as the following
3. New vsftpd.chroot_list file, did not need to fill in, empty can.
we /etc/vsftpd.chroot_list
4. New vsftpd.user_list file
we /etc/vsftpd.user_list
myftp
Add ftp login name in vsftpd.user_list in. Here with myftp.
5. Start vsftpd, testing
sudo /etc/init.d/vsftpd start
This line appears ok configuration was successful.
6. Add the user name ftp
(1) groupadd vsftpd # Create a user group
(2) mkdir / home / myftp # create ftp directory
(3) useradd -g vsftpd myftp # creating a user, vsftpd group created for the above, myftp username
(4) passwd myftp # change your password, you will be prompted twice, the second time to confirm the password.
(5) vi / etc / passwd # myftp find after entering the user just added in the last add / sbin / nologin, as follows
myftp:x:1001:1002::/home/myftp:/sbin/nologin
After saving.
(6) vi / etc / shells # Set myftp users can not log in directly linux system. In the final plus / sbin / nologin
7. Modify the user permissions ftp directory myftp
chmod a-w /home/myftp
8. Start ftp.
/etc/init.d/vsftpd start.
Two, ftp client installation
1. Install ftp
apt-get install ftp
2. landing. At the same machine test.
ftp 192.168.100
When prompted to enter a user name and password
myftp
myftp
If successful shows information above.