Create and assign user access ftp directory

In Linux add ftp user, and set the appropriate permissions, as follows:

1, environment: ftp is vsftp. It is limited to a user named test. It is limited path / home / test

2, built user: root user:

useradd -d / home / ftp ftpname // increase user test, and develop ftpname user's home directory is / Home / the FTP
passwd ftpname // set a password for ftpname

3, change the appropriate permissions set by the user:

usermod -s / sbin / nologin ftpname // define user ftpname not use telnet, only use the FTP
the usermod -s / sbin / bash ftpname // user test normal
usermod -d / ftp ftpname // change the user's home directory is ftpname / the FTP

4, users are restricted to / home / ftp, you can not access other path

/Etc/vsftpd/vsftpd.conf modified as follows:

chroot_list_enable = YES # restrict access to their catalog
# (default Follows)
chroot_list_file = / etc / vsftpd / vsftpd.chroot_list

The new editor vsftpd.chroot_list file, the user will be restricted added to it, each user name row

End change the configuration file, do not forget to restart vsFTPd server
[root @ linuxspliu root] # service vsftpd restart

5. If you need to allow users to change the password, but it does not have permission to telnet system:

usermod -s / usr / bin / passwd test # telnet users will directly enter the password changing interface

Guess you like

Origin www.cnblogs.com/jn1011/p/10966074.html