SFTP & CentOS 7.4
SFTP
sftp(Secure File Transfer Protocol)in ssh with ssh start, default port: 22
Envirement:CentOS 7.4
Server IP:192.168.31.55
[root@localhost ~]# groupadd sftp
[root@localhost ~]# useradd -g sftp -s /sbin/nologin sftpuser
[root@localhost ~]# echo "123456" | passwd --stdin sftpuser
[root@localhost ~]# mkdir -p /home/sftp/sftpuser
[root@localhost ~]# chown -R sftpuser:sftp /home/sftp/sftpuser
[root@localhost ~]# vi /etc/ssh/sshd_config
#Subsystem sftp /usr/libexec/openssh/sftp-server
Subsystem sftp internal-sftp
Match User sftpuser
ChrootDirectory /home/sftp
AllowTcpForwarding no
ForceCommand internal-sftp
wq
[root@localhost ~]# systemctl restart sshd.service
In client side
sftp sftpuser@192.168.31.55
评论
发表评论