美文网首页
ubuntu 设置sftp服务

ubuntu 设置sftp服务

作者: zbharper | 来源:发表于2020-09-02 17:57 被阅读0次

https://blog.csdn.net/bbc2005/article/details/80034065
按照这篇的步骤, 使用账号sftp无法连上sftp.

经测试将用户sftp的根目录与sshd_config 中ChrootDirectory 指定的目录一致后,sftp连接正常.

sudo usermod -d /data/sftp sftp   # 用户sftp的根目录为/data/sftp

sshd_config 最后添加的配置为:

Match User sftp   # 只限制用户sftp
ChrootDirectory /data/sftp
AllowTcpForwarding no
X11Forwarding no
ForceCommand internal-sftp

相关文章

网友评论

      本文标题:ubuntu 设置sftp服务

      本文链接:https://www.haomeiwen.com/subject/asbwsktx.html