在CENTOS上执行

1 cp /usr/sbin/sshd /usr/sbin/sftpd
2 cp /etc/pam.d/sshd /etc/pam.d/sftpd
3 cp /etc/ssh/sshd_config /etc/ssh/sftpd_config

vi sftpd_config
Port 9091
Match User inscgb
ChrootDirectory /home/inscgb
ForceCommand internal-sftp
X11Forwarding no
AllowTcpForwarding no
PermitTTY no

#Match Group sftpgroup

目录要求,账号的根目录及以上目录都要属于root
[root@iZuf62ujq5zpxy5gzgntjsZ ~]# ls -ld /home/inscgb
drwxr-xr-x 4 root root 4096 Jun 29 16:00 /home/inscgb
[root@iZuf62ujq5zpxy5gzgntjsZ ~]# ls -ld /home/
drwxr-xr-x. 9 root root 4096 Jun 29 15:59 /home/
[root@iZuf62ujq5zpxy5gzgntjsZ ~]# ls -ld /home/inscgb/doc
drwxrwxrwx 2 root root 4096 Jun 29 16:00 /home/inscgb/doc

/usr/sbin/sftpd -f /etc/ssh/sftpd_config &

相关文章:

  • 2021-07-08
  • 2021-05-28
  • 2021-11-21
  • 2021-08-23
  • 2021-08-30
  • 2022-01-08
  • 2021-11-29
猜你喜欢
  • 2021-06-24
  • 2022-12-23
  • 2021-11-27
  • 2021-11-27
  • 2021-10-18
  • 2021-06-23
  • 2022-01-28
相关资源
相似解决方案