scp验证但仅提供欢迎消息

时间:2015-01-28 19:42:52

标签: bash ssh scp

我想使用无密码scp

scp -i ~/.ssh/id_rsa -P 2022 ~/report.pdf user1@myserver.com:~/

但我只能

欢迎use​​r1到p6。 2015年1月28日星期三 - 美国东部时间下午14:46

我添加了必要的密钥,并显示了正确的身份验证。当我以详细模式进行操作时,我得到了

Executing: program /usr/bin/ssh host myserver.com, user user1, command scp -v -t ~/
OpenSSH_6.2p2, OSSLShim 0.9.8r 8 Dec 2011
debug1: Reading configuration data /etc/ssh_config
debug1: /etc/ssh_config line 20: Applying options for *
debug1: /etc/ssh_config line 53: Applying options for *
debug1: Connecting to myserver.com [X.X.X.X] port 2022.
debug1: Connection established.
debug1: identity file /Users/morteza/.ssh/id_rsa type 1
debug1: identity file /Users/morteza/.ssh/id_rsa-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.2
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1p1 Ubuntu-2ubuntu2
debug1: match: OpenSSH_6.6.1p1 Ubuntu-2ubuntu2 pat OpenSSH*
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5-etm@openssh.com none
debug1: kex: client->server aes128-ctr hmac-md5-etm@openssh.com none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Server host key: RSA 65:b1:52:b3:b5:1a:ff:f6:c7:3a:e7:82:dd:e2:16:32
debug1: Host '[myserver.com]:2022' is known and matches the RSA host key.
debug1: Found key in /Users/morteza/.ssh/known_hosts:15
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /Users/morteza/.ssh/id_rsa
debug1: Server accepts key: pkalg ssh-rsa blen 279
debug1: read PEM private key done: type RSA
debug1: Authentication succeeded (publickey).
Authenticated to myserver.com ([X.X.X.X]:2022).
debug1: channel 0: new [client-session]
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug1: Sending environment.
debug1: Sending env LC_MONETARY = en_US.utf-8
debug1: Sending env LC_NUMERIC = en_US.utf-8
debug1: Sending env LC_ALL = POSIX
debug1: Sending env LC_MESSAGES = en_US.utf-8
debug1: Sending env LC_COLLATE = en_US.utf-8
debug1: Sending env LC_CTYPE = en_US.utf-8
debug1: Sending env LC_TIME = en_US.utf-8
debug1: Sending command: scp -v -t ~/
Welcome user1 to p6.             Wed, 28 Jan 2015 - 14:42 PM EST
debug1: client_input_channel_req: channel 0 rtype exit-signal reply 0
debug1: channel 0: free: client-session, nchannels 1
debug1: fd 0 clearing O_NONBLOCK
debug1: fd 1 clearing O_NONBLOCK
Transferred: sent 3480, received 3336 bytes, in 0.7 seconds
Bytes per second: sent 5245.4, received 5028.3
debug1: Exit status -1

任何线索有什么不对?看起来无论我在目的地机器上给它什么路径都不关心。

1 个答案:

答案 0 :(得分:0)

主要问题是在ssh会话开始时打印的统计信息和欢迎消息。唯一的解决方案是删除.bashrc或相关文件中的任何echo语句或任何可能打印某些统计信息行的脚本,例如在ubuntu中由landscape.canonical.com打印的消息。