First identify a few things before you start the operation
(1) Determine the sshd version is higher than 4.8
(2) Confirm that SELinux is off, or authorize the corresponding directory
(3) Be sure to follow the steps otherwise there may be permissions issues
(4) The following command uses root operation
1. Create an SFTP user group
Groupadd sftpusers
2. Create a directory that specifies to block
mkdir/home/sftp/sunsun/
3. Create a user and specify the directory of the user's home directory as chroot
Useradd-s/bin/false-g sftpusers-d/home/sftp/sunsun/sunsun
4. Set the password
passwd Sunsun
5. Create an Upload directory
Mkdir/home/sftp/sunsun/upload
6. Authorized user permissions on this directory
Chown Sunsun:sftpusers/home/sftp/sunsun/upload
7. Modify the SSHD profile---a few lines of content added to the profile are best added at the end of the configuration file, or you might see the following error message "*usedns*"
Vim/etc/ssh/sshd_config (edit this directory)
Subsystem sftp internal-sftp
Match Group Sftpusers
Chrootdirectory%h
Forcecommand internal-sftp
Allowtcpforwarding No
X11forwarding No
Restart the SSHD service after Setup is complete
This article is from the "Horse Walking Day" blog, please be sure to keep this source http://mazouri.blog.51cto.com/9764673/1760353
SFTP user throttling settings