使用openssh自带的sftp功能,并禁用shell,还自带天然chroot功能!在/etc/ssh/sshd_config最后配置Match段: Match User druggo    ChrootDirectory %h    X11Forwarding no    AllowTcpForwarding no    ForceCommand internal-sftp 该账户登录ssh会提示This service allows sftp connections only然后退出。(5.4之前的版本不会提示而是一直等待)。也可以Match Group对多个账户更方便! 注意事项:1.  […]