首先,我要解释一下我想做什么。我已经在vmware-esxi之上设置了一个运行ubuntu服务器的set服务器。我想使用SFTP通过SSH上传我的网站的代码。我们是在我学习的php类中这样做的。
我跟踪了这个指南。
因此,我有一个名为sftpuser的用户和一个名为sftp的组,当我试图连接时,它会产生错误:
packet_write_wait: Connection to x.x.x.x port 22: Broken pipe我的ssh配置在底部看这个,其余的没有变化。
ClientAliveInterval 20
ClientAliveCountMax 5
TCPKeepAlive yes
Match group sftp
ChrootDirectory %h
X11Forwarding no
AllowTcpForwarding no
ForceCommand internal-sftp我是linux新手,所以我不确定原因是什么。谢谢。
编辑:
/var/log/auth.log中的错误是
fatal: bad ownership of chroot directory component "/var/www"发布于 2019-01-16 18:31:50
好的,问题似乎是我没有/var/www的权限,当我更改了指南中所示的权限时,我对/var/www/html进行了修改。所以当我运行这个
cd /var/www
chown root:sftp .
chmod 755 .
chown -R sftpuser:sftp *啊,真灵。为了确定,我还在/var/www/html上再次运行了它。
https://askubuntu.com/questions/1109840
复制相似问题