首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >不工作scp命令:由远程主机关闭连接(Mac )

不工作scp命令:由远程主机关闭连接(Mac )
EN

Stack Overflow用户
提问于 2015-05-19 13:09:19
回答 8查看 35.7K关注 0票数 9

我正在通过Mac终端处理远程服务器,因为我从10.5中将它更新为OSX 10.10,每次我尝试从服务器到我的计算机上scp时,我就开始接收这条消息:

代码语言:javascript
运行
复制
ssh_exchange_identification: Connection closed by remote host
lost connection

如果我向后执行scp (从mac复制到服务器),它会很好地工作,如果我从另一个mac执行它也会很好。

如果我做了一个verobse scp,它会给我以下内容:

代码语言:javascript
运行
复制
Executing: program /usr/bin/ssh host xx.xx.xx.x, user User, command scp -v -t /Users/User
OpenSSH_5.3p1, OpenSSL 1.0.1e-fips 11 Feb 2013
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to xx.xx.xx.x [xx.xx.xx.x] port 22.
debug1: Connection established.
debug1: identity file /home/user/.ssh/identity type -1
debug1: identity file /home/user/.ssh/identity-cert type -1
debug1: identity file /home/user/.ssh/id_rsa type -1
debug1: identity file /home/user/.ssh/id_rsa-cert type -1
debug1: identity file /home/user/.ssh/id_dsa type -1
debug1: identity file /home/user/.ssh/id_dsa-cert type -1
debug1: identity file /home/user/.ssh/id_ecdsa type -1
debug1: identity file /home/user/.ssh/id_ecdsa-cert type -1
ssh_exchange_identification: Connection closed by remote host
lost connection

我试着查看各种主机、config、ssh文件,但我没有解决太多问题。

EN

Stack Overflow用户

回答已采纳

发布于 2015-05-27 18:24:08

从我的个人Mac到我们作为本地服务器使用的Mac桌面,我只是遇到了同样的问题。运行sudo sshd -t向我展示了以下提示:

代码语言:javascript
运行
复制
/var/empty must be owned by root and not group or world-writable

我所做的只是将所有者改为root (我不知道为什么还没有,但我记得从小牛队升级到Yosemite给我带来了一些权限方面的麻烦):

代码语言:javascript
运行
复制
cd /var
sudo chown root empty

希望能帮上忙。

票数 7
EN
查看全部 8 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/30326594

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档