主机通过 ssh 命令连接服务器,能PING通,但无法登录

ubuntu主机通过 ssh 命令连接服务器,能PING通,但无法登录

1、如题,主机通过服务器能ping通,但是无法登录,服务器端口,说明物理连接上基本没什么问题
2、当通过 ssh useername@(服务器端口IP)
卡在终端
3、此时使用debug

ssh -v  (服务器IP)
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to 192.168.125.101 [192.168.125.101] port 22.
debug1: Connection established.
debug1: key_load_public: No such file or directory
debug1: identity file /home/sikander/.ssh/id_rsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/sikander/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/sikander/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/sikander/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/sikander/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/sikander/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/sikander/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/sikander/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.2p2 Ubuntu-4ubuntu2.10
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.9p1 Debian-5ubuntu1
debug1: match: OpenSSH_5.9p1 Debian-5ubuntu1 pat OpenSSH_5* compat 0x0c000000
debug1: Authenticating to 192.168.125.101:22 as 'username'
debug1: SSH2_MSG_KEXINIT sent

卡在

SSH2_MSG_KEXINIT sent

另外开终端使用

sudo dpkg-reconfigure openssh-server
 sudo dpkg-reconfigure openssh-server 
Creating SSH2 RSA key; this may take some time ...
2048 SHA256:1Hmt2rY3mG5BPTDKAtvr1AzLeyjhc/8rhVPCq4uP9nE root@pc (RSA)
Creating SSH2 DSA key; this may take some time ...
1024 SHA256:j3kF9xvWAFb5hxlC3K55ONdcaAxwzqxNT9DgfDRdqnM root@pc (DSA)
Creating SSH2 ECDSA key; this may take some time ...
256 SHA256:s+PTrxu1SWTj/XcR0xedsY80lMb1dY28MuY9e7JbtOM root@pc (ECDSA)
Creating SSH2 ED25519 key; this may take some time ...
256 SHA256:ARJOPPhsJoFsLDHU2yvYV03XNqpMYd08h+N7Mpvhqrw root@pc (ED25519)

然后再使用

ssh username@(服务器端IP)
The authenticity of host '192.168.125.101 (192.168.125.101)' can't be established.
ECDSA key fingerprint is SHA256:FUHlyPynTawgwyN+wGze53s3Mj8YzESIvfXYt8sLoz8.
Are you sure you want to continue connecting (yes/no)? y
Please type 'yes' or 'no': yes
Warning: Permanently added '192.168.125.101' (ECDSA) to the list of known hosts.
robot@192.168.125.101's password: 
Welcome to Ubuntu 12.04 LTS (GNU/Linux 4.9.38-xenomai-3.0.5 i686)

 * Documentation:  https://help.ubuntu.com/
Last login: Mon Dec 31 19:05:59 2001 from 192.168.125.100

又可以正常登录远程服务器端了

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值