无法使用终端 SSH 连接到云服务器,但可以使用 Putty 进行连接

无法使用终端 SSH 连接到云服务器,但可以使用 Putty 进行连接

我需要有关 SSH 的帮助。我无法使用 Lubuntu 终端通过 SSH 连接到 Ubuntu 云服务器。我不知道问题的根源在哪里。但是,我可以使用 Putty 通过 SSH 连接到服务器。以下是终端输出。谢谢。

OpenSSH_8.0p1, OpenSSL 1.1.1f  31 Mar 2020
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug1: Connecting to 193.122.150.39 [193.122.150.39] port 22.
debug1: Connection established.
debug1: identity file /home/luins/.ssh/id_rsa type -1
debug1: identity file /home/luins/.ssh/id_rsa-cert type -1
debug1: identity file /home/luins/.ssh/id_dsa type -1
debug1: identity file /home/luins/.ssh/id_dsa-cert type -1
debug1: identity file /home/luins/.ssh/id_ecdsa type -1
debug1: identity file /home/luins/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/luins/.ssh/id_ed25519 type -1
debug1: identity file /home/luins/.ssh/id_ed25519-cert type -1
debug1: identity file /home/luins/.ssh/id_xmss type -1
debug1: identity file /home/luins/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.0
debug1: Remote protocol version 2.0, remote software version OpenSSH_8.2p1 Ubuntu-4ubuntu0.2
debug1: match: OpenSSH_8.2p1 Ubuntu-4ubuntu0.2 pat OpenSSH* compat 0x04000000
debug1: Authenticating to 193.122.150.39:22 as 'ubuntu'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: [email protected] MAC: <implicit> compression: none
debug1: kex: client->server cipher: [email protected] MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:/7QT8lVebQzkPSVPV8kAMtDDjLc4tei3UifHtvrAZi4
debug1: Host '193.122.150.39' is known and matches the ECDSA host key.
debug1: Found key in /home/luins/.ssh/known_hosts:1
debug1: rekey out after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey in after 134217728 blocks
debug1: Will attempt key: nslui@nslui-pc RSA SHA256:/4EEJJFVZ7XGXuJEyGq3hx6k3WOtpBTb4DUr8TA030E agent
debug1: Will attempt key: /home/luins/.ssh/id_rsa 
debug1: Will attempt key: /home/luins/.ssh/id_dsa 
debug1: Will attempt key: /home/luins/.ssh/id_ecdsa 
debug1: Will attempt key: /home/luins/.ssh/id_ed25519 
debug1: Will attempt key: /home/luins/.ssh/id_xmss 
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,[email protected],ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,[email protected]>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering public key: nslui@nslui-pc RSA SHA256:/4EEJJFVZ7XGXuJEyGq3hx6k3WOtpBTb4DUr8TA030E agent
debug1: Server accepts key: nslui@nslui-pc RSA SHA256:/4EEJJFVZ7XGXuJEyGq3hx6k3WOtpBTb4DUr8TA030E agent
debug1: Authentication succeeded (publickey).
Authenticated to 193.122.150.39 ([193.122.150.39]:22).
debug1: channel 0: new [client-session]
debug1: Requesting [email protected]
debug1: Entering interactive session.
debug1: pledge: network
debug1: client_input_global_request: rtype [email protected] want_reply 0
debug1: Remote: /home/ubuntu/.ssh/authorized_keys:2: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding
debug1: Remote: /home/ubuntu/.ssh/authorized_keys:2: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding
debug1: Sending environment.
debug1: Sending env LC_ADDRESS = ms_MY.UTF-8
debug1: Sending env LC_NAME = ms_MY.UTF-8
debug1: Sending env LC_MONETARY = en_MY.UTF-8
debug1: Sending env LC_PAPER = ms_MY.UTF-8
debug1: Sending env LANG = en_US.UTF-8
debug1: Sending env LC_IDENTIFICATION = ms_MY.UTF-8
debug1: Sending env LC_TELEPHONE = ms_MY.UTF-8
debug1: Sending env LC_MEASUREMENT = en_MY.UTF-8
debug1: Sending env LC_TIME = en_MY.UTF-8
debug1: Sending env LC_NUMERIC = en_MY.UTF-8
debug1: Sending command: i /home/luins/.ssh/ocp_key
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: client_input_channel_req: channel 0 rtype [email protected] reply 0
bash: i: command not found
debug1: channel 0: free: client-session, nchannels 1
Transferred: sent 3660, received 3168 bytes, in 1.0 seconds
Bytes per second: sent 3770.1, received 3263.3
debug1: Exit status 127

我的 ssh 配置

# This is the ssh client system-wide configuration file.  See
# ssh_config(5) for more information.  This file provides defaults for
# users, and the values can be changed in per-user configuration files
# or on the command line.

# Configuration data is parsed as follows:
#  1. command line options
#  2. user-specific file
#  3. system-wide file
# Any configuration value is only changed the first time it is set.
# Thus, host-specific definitions should be at the beginning of the
# configuration file, and defaults at the end.

# Site-wide defaults for some commonly used options.  For a comprehensive
# list of available options, their meanings and defaults, please see the
# ssh_config(5) man page.

Include /etc/ssh/ssh_config.d/*.conf

Host *
#   ForwardAgent no
#   ForwardX11 no
#   ForwardX11Trusted yes
#   PasswordAuthentication yes
#   HostbasedAuthentication no
#   GSSAPIAuthentication no
#   GSSAPIDelegateCredentials no
#   GSSAPIKeyExchange no
#   GSSAPITrustDNS no
#   BatchMode no
#   CheckHostIP yes
#   AddressFamily any
#   ConnectTimeout 0
#   StrictHostKeyChecking ask
#   IdentityFile ~/.ssh/id_rsa
#   IdentityFile ~/.ssh/id_dsa
#   IdentityFile ~/.ssh/id_ecdsa
#   IdentityFile ~/.ssh/id_ed25519
#   Port 22
#   Ciphers aes128-ctr,aes192-ctr,aes256-ctr,aes128-cbc,3des-cbc
#   MACs hmac-md5,hmac-sha1,[email protected]
#   EscapeChar ~
#   Tunnel no
#   TunnelDevice any:any
#   PermitLocalCommand no
#   VisualHostKey no
#   ProxyCommand ssh -q -W %h:%p gateway.example.com
#   RekeyLimit 1G 1h
    SendEnv LANG LC_*
    HashKnownHosts yes
#   GSSAPIAuthentication yes

我的 ssh 终端命令

ssh [email protected] -i ~/.ssh/ocp_key

相关内容