ubuntu 设置sftp服务

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服务)