![为什么我无法通过 ssh 连接到 azure 中的 Ubuntu VM?](https://linux22.com/image/654561/%E4%B8%BA%E4%BB%80%E4%B9%88%E6%88%91%E6%97%A0%E6%B3%95%E9%80%9A%E8%BF%87%20ssh%20%E8%BF%9E%E6%8E%A5%E5%88%B0%20azure%20%E4%B8%AD%E7%9A%84%20Ubuntu%20VM%EF%BC%9F.png)
我在 Windows Azure 中使用 Ubuntu 14.04 映像创建了一个新的 VM。我尝试使用 ssh 连接 VM。但它显示类似以下内容。您能帮助我了解这里出了什么问题吗?
这是终端的输出。
ssh -v ****.cloudapp.net : 22
OpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to ***.cloudapp.net [104.42.12.189] port 22.
debug1: Connection established.
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
debug1: identity file /home/user/.ssh/id_ed25519 type -1
debug1: identity file /home/user/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-2ubuntu2
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_6.6.1* compat 0x04000000
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr [email protected] none
debug1: kex: client->server aes128-ctr [email protected] none
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ECDSA a2:be:a9:21:ca:a2:e3:96:e1:b3:c3:e9:63:6d:c5:ac
debug1: Host '***.cloudapp.net' is known and matches the ECDSA host key.
debug1: Found key in /home/user/.ssh/known_hosts:28
debug1: ssh_ecdsa_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: /home/user/.ssh/id_rsa
debug1: Authentications that can continue: publickey,password
debug1: Trying private key: /home/user/.ssh/id_dsa
debug1: Trying private key: /home/user/.ssh/id_ecdsa
debug1: Trying private key: /home/user/.ssh/id_ed25519
debug1: Next authentication method: password
user@*****.cloudapp.net's password:
debug1: Authentication succeeded (password).
Authenticated to *****.cloudapp.net ([104.42.12.189]:22).
debug1: channel 0: new [client-session]
debug1: Requesting [email protected]
debug1: Entering interactive session.
debug1: Sending environment.
debug1: Sending env LANG = en_IN
debug1: Sending env LC_CTYPE = en_IN
debug1: Sending command: : 22
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: client_input_channel_req: channel 0 rtype [email protected] reply 0
debug1: channel 0: free: client-session, nchannels 1
Transferred: sent 2908, received 2228 bytes, in 0.8 seconds
Bytes per second: sent 3585.2, received 2746.8
debug1: Exit status 0
谢谢你!
答案1
您的命令(ssh -v example.cloudapp.net : 22
)表示连接到example.cloudapp.net
然后执行命令: 22
并退出。
据我所见,它成功做到了这一点。
我猜你尝试指定端口号(?)但你没有这样做。首先,端口 22 是 ssh 的默认端口,因此无需指定它,但如果你需要指定端口,请使用-p
。
有关含义的一些信息: 22
:
$ type :
: is a shell builtin
$ help :
:: :
Null command.
No effect; the command does nothing.
Exit Status:
Always succeeds.
$