我一直试图在debian服务器上配置sftp .sshd_config:
。
Subsystem sftp internal-sftp
UsePAM no
Match User sftpUser
ChrootDirectory /users/sftp/sftpUser
ForceCommand internal-sftp
AllowTcpForwarding no
X11Forwarding no
目录:
drwxr-xr-x 3 root root 4096 Oct 20 10:59 users
drwxr-xr-x 3 root root 4096 Oct 20 11:00 sftp
drwxr-xr-x 2 root root 4096 Oct 20 11:00 sftpUser
cat /var/log/auth.log
Oct 20 10:58:22 w1 sshd[24634]: Accepted password for sftpUser from 201.156.103.213 port 34106 ssh2
Oct 20 10:58:22 w1 sshd[24636]: fatal: bad ownership or modes for chroot directory component "/"
sftpUser没有家,bin/false
和用户组成员。
在客户端,我得到了著名的Write failed: Broken pipe
,然后取消了连接。在ChrootDirectory
中注释sshd_config命令可以建立连接,但是get的用户是松散的。
我做错什么了?
发布于 2015-10-20 17:23:16
在ChrootDirectory
中使用sshd_config
选项需要对书面文本有一些基本的理解。
这是来自sshd_config(5)
手册页面的快照:
ChrootDirectory指定
chroot(2)
身份验证后到的目录的路径名。路径名的所有组件都必须是根所有的目录,任何其他用户或组都不能写。在chroot之后,sshd(8)
将工作目录更改为用户的主目录。
这是您的错误日志:
fatal: bad ownership or modes for chroot directory component "/"
这意味着您需要确保实现引号中强调的部分:您的/
需要由root拥有,并且只为所有者拥有w
。
https://serverfault.com/questions/730305
复制相似问题