SFTP installation
SFTP implements file transfer, but cannot log on to the system
1.SFTP More secure
Only under your own home directory
Groupadd SFTP
Useradd-g sftp-s/sbin/nologin-d/sftp/wuang (that is, the folder as the user's home directory) Wuang
passwd Wuang
Modify Sshd_config
Found it
Subsystem Sftp/usr/libexec/openssh/sftp-server
Comment out
Add to
Subsystem sftp internal-sftp
Match Group SFTP
#Match User Wuang
#ChrootDirectory/sftp/wuang
Chrootdirectory/sftp/%u
Forcecommand internal-sftp
Allowtcpforwarding No
X11forwarding No
There are two key points to setting permissions for a directory:
1. The directory owner that is specified by Chrootdirectory to start all the way up to the root of the system can only be root
2, the directory specified by chrootdirectory starts to go up to the system root directory can not have group write permission
/SFTP 755 can be
Also need to be built under/sftp/wuang
Folders that can be uploaded
Mkdir/sftp/wuang/upload
Chown Root:root/sftp/wuang
Chown Wuang:sftp/sftp/wuang/upload
chmod 755/sftp/wuang/upload
SELinux needs to be closed
This article is from the "Don't Ang" blog, please be sure to keep this source http://wuang.blog.51cto.com/9559762/1606198
Linux setup SFTP