scp-lost-connection

debug the reason

[root@catfish ~]# scp -v /etc/samba/smb.conf root@192.168.68.9:/etc/samba/
Executing: program /usr/bin/ssh host 192.168.68.9, user root, command scp -v -t /etc/samba/
OpenSSH_5.3p1, OpenSSL 1.0.0-fips 29 Mar 2010
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to 192.168.68.9 [192.168.68.9] port 22.
debug1: Connection established.
debug1: permanently_set_uid: 0/0
debug1: identity file /root/.ssh/identity type -1
debug1: identity file /root/.ssh/id_rsa type -1
debug1: identity file /root/.ssh/id_dsa type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.3
debug1: match: OpenSSH_5.3 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.3
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: kex: client->server aes128-ctr hmac-md5 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: Host '192.168.68.9' is known and matches the RSA host key.
debug1: Found key in /root/.ssh/known_hosts:3
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: Next authentication method: gssapi-keyex
debug1: No valid Key exchange context
debug1: Next authentication method: gssapi-with-mic
debug1: An invalid name was supplied
Cannot determine realm for numeric host address

debug1: An invalid name was supplied
Cannot determine realm for numeric host address

debug1: An invalid name was supplied


debug1: An invalid name was supplied


debug1: Next authentication method: publickey
debug1: Trying private key: /root/.ssh/identity
debug1: Trying private key: /root/.ssh/id_rsa
debug1: Trying private key: /root/.ssh/id_dsa
debug1: Next authentication method: password
root@192.168.68.9's password:

From above log ,it showed :

debug1: Next authentication method: gssapi-with-mic
debug1: An invalid name was supplied
Cannot determine realm for numeric host address

So ,the we need to change GSS autherization

Three method to fix such error

## method 1
scp -o GSSAPIAuthentication=no file remote-ip:/tmp/

## method 2
[ !-f /home/colin/.ssh/config ] && touch /home/colin/.ssh/config
echo "GSSAPIAuthentication no" > /home/colin/.ssh/config
Note : this method only for current user `colin`

## method 3
sed -i 's/#   GSSAPIAuthentication no/GSSAPIAuthentication no/' /etc/ssh/ssh_config
/etc/init.d/sshd restart

Attachment

Sometimes when you try to use scp command ,but find there was no such one , and try use yum install scp to install and met error No package scp available.

The reason is the command scp located in package openssh-clients, if you want to install scp, you need to try with yum install -y openssh-clients

And then debug again, no such waiting error. Fix successfully !

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • PLEASE READ THE FOLLOWING APPLE DEVELOPER PROGRAM LICENSE...
    念念不忘的阅读 13,552评论 5 6
  • **2014真题Directions:Read the following text. Choose the be...
    又是夜半惊坐起阅读 9,939评论 0 23
  • NAME dnsmasq - A lightweight DHCP and caching DNS server....
    ximitc阅读 2,936评论 0 0
  • 圣穆夫人 写几句话,赞美一下快要被历史的尘沙掩埋掉的佳人 孟津渡上,偏偏那河水泛滥。 秋雨绵绵,八马大车难向前。 ...
    秃头小花鹿阅读 244评论 0 1
  • 太爱你了。每次看超级个体的时候感觉到自己像一个海绵一样,自己有很多困惑,有些还是说不出来的,但看完超级个体里面的章...
    魔镜Mirro阅读 198评论 0 0