【发布时间】:2017-02-08 07:24:24
【问题描述】:
我有一个小的 shell 脚本,我在 Linux 和 OS-X travis 实例上使用它来将工件 scp 到服务器 (akamai) 我没有 shell 访问权限(看不到日志),然后更改名称(通过ssh 命令)。
但是,它在 Linux 上运行良好,但在 OSX 上不运行。 akamai 服务器正在运行 SSH-1.99-Server-VIII-hpn14v2。
例如,甚至像这样简单的事情:
ssh user@remote 'ls -l'
…有问题。
当事情在 linux 上运行时,它工作正常(来自ssh -vvv 的输出)(在发送命令和这些版本的 ssh 的响应之间没有任何有趣的 debug3 消息)。
OpenSSH_5.9p1 Debian-5ubuntu1.10, OpenSSL 1.0.1 14 Mar 2012
[snip]
debug1: Sending command: ls -l
debug2: channel 0: request exec confirm 1
debug2: callback done
debug2: channel 0: open confirm rwindow 0 rmax 32768
debug2: channel 0: rcvd adjust 2097152
debug2: channel_input_status_confirm: type 99 id 0
debug2: exec request accepted on channel 0
drwxrwxr-x rgetz4trav storage 0 Feb 05 16:44 336936
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: client_input_channel_req: channel 0 rtype eow@openssh.com reply 0
当事情从 OS-X 运行时,它永远不会看到响应。
OpenSSH_6.2p2, OSSLShim 0.9.8r 8 Dec 2011
[snip]
debug1: Sending command: ls -l
debug2: channel 0: request exec confirm 1
debug2: callback done
debug2: channel 0: open confirm rwindow 0 rmax 32768
debug2: channel 0: rcvd adjust 2097152
debug2: channel_input_status_confirm: type 99 id 0
debug2: exec request accepted on channel 0
debug2: channel 0: read<=0 rfd 6 len 0
debug2: channel 0: read failed
debug2: channel 0: close_read
debug2: channel 0: input open -> drain
debug2: channel 0: ibuf empty
debug2: channel 0: send eof
debug2: channel 0: input drain -> closed
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug2: channel 0: rcvd eof
我环顾四周 - 并无法弄清楚有什么不同。
有什么建议吗?
【问题讨论】:
-
ssh -vv没有足够详细的输出来判断发生了什么。请运行它并添加v—ssh -vvv,然后 edit your question 将ssh -vvv添加到它作为更新。 -
服务器的 OpenSSH 版本是什么?您在服务器日志中看到什么错误?您要连接的两个用户的默认 shell 是什么?
-
OSX ssh 是相当最新的 OpenSSH 版本,与 Linux 上的版本相同。如果您有一台服务器将 OSX 客户端与 Linux 客户端区别对待,您应该查看服务器配置。
-
我在问题中添加了一些信息 - 如前所述,我无权访问任何日志 - 一个是 travis-CI 容器,另一个是网络存储。