编辑:将 ssh 密钥的名称更改为 id_rsa,仍然有问题。

编辑:将 ssh 密钥的名称更改为 id_rsa,仍然有问题。

我尝试在两台计算机(clementine 和 cfmi)上设置公钥和私钥,这样我就可以在不使用密码的情况下在它们之间进行 ssh 操作。但是,尽管我将公钥包含在 ~/.ssh 下的授权密钥文件中,系统仍要求我输入密码。

当我尝试从 clementine 连接时,我可以登录到 cfmi 服务器,但是系统提示我输入密码。

这可能也相关,我必须首先使用 Cisco AnyConnect 连接到 VPN 网络,然后才能 ssh 进入 cfmi,因为它有防火墙。

然而,当我尝试从 cfmi 服务器连接到 clementine 时,系统提示我输入密码与 root 密码不匹配我在那台电脑上安装了。因此我无法从 cfmi 登录到 clementine。

它变得更加神秘...当我在本地网络上从我的 iphone 进行 ssh 时,root 密码工作正常。

有人能帮助我弄清楚如何让密钥发挥作用以及如何重置我的密码以通过 ssh 进入 Clementine 吗?

编辑:将 ssh 密钥的名称更改为 id_rsa,仍然有问题。

以下是客户端(cf​​mi)上.ssh 的内容:

-rwx------. 1 se394 mriusers 1634 Sep 29 22:00 authorized_keys
-rwx------. 1 se394 mriusers 1633 Sep 29 22:00 authorized_keys~
-rw-------. 1 se394 mriusers 1675 Sep 29 21:17 clementine
-rw-r--r--. 1 se394 mriusers  415 Sep 28 19:52 clementine.pub
-rw-------. 1 se394 mriusers 1679 Sep 29 22:04 id_rsa
-rw-r--r--. 1 se394 mriusers  415 Sep 29 22:04 id_rsa.pub
-rw-r--r--. 1 se394 mriusers 1830 Sep 28 20:15 #known_hosts#
-rw-r--r--. 1 se394 mriusers 1043 Sep 29 00:13 known_hosts
-rw-r--r--. 1 se394 mriusers 1837 Sep 28 17:41 known_hosts~

以下是 cfmi 连接到 clementine 的详细输出

se394 ~ $ ssh -v -v -v [email protected]
OpenSSH_6.4, OpenSSL 1.0.1e-fips 11 Feb 2013
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 51: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to clementine.duckdns.org [162.211.160.162] port 22.
debug1: Connection established.
debug3: Incorrect RSA1 identifier
debug3: Could not load "/exports/home/se394/.ssh/id_rsa" as a RSA1 public key
debug1: identity file /exports/home/se394/.ssh/id_rsa type 1
debug1: identity file /exports/home/se394/.ssh/id_rsa-cert type -1
debug1: identity file /exports/home/se394/.ssh/id_dsa type -1
debug1: identity file /exports/home/se394/.ssh/id_dsa-cert type -1
debug1: identity file /exports/home/se394/.ssh/id_ecdsa type -1
debug1: identity file /exports/home/se394/.ssh/id_ecdsa-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.4
debug1: Remote protocol version 2.0, remote software version Cisco-1.25
debug1: no match: Cisco-1.25
debug2: fd 3 setting O_NONBLOCK
debug3: load_hostkeys: loading entries for host "clementine.duckdns.org" from file "/exports/home/se394/.ssh/known_hosts"
debug3: load_hostkeys: found key type RSA in file /exports/home/se394/.ssh/known_hosts:3
debug3: load_hostkeys: loaded 1 keys
debug3: order_hostkeyalgs: prefer hostkeyalgs: [email protected],[email protected],ssh-rsa
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug2: kex_parse_kexinit: ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: [email protected],[email protected],ssh-rsa,[email protected],[email protected],[email protected],[email protected],[email protected],ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-dss
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,[email protected],[email protected],aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected]
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,[email protected],[email protected],aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected]
debug2: kex_parse_kexinit: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-md5,hmac-sha1,[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-md5,hmac-sha1,[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,[email protected],zlib
debug2: kex_parse_kexinit: none,[email protected],zlib
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: first_kex_follows 0 
debug2: kex_parse_kexinit: reserved 0 
debug2: kex_parse_kexinit: diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: ssh-rsa
debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,aes192-cbc,aes256-cbc
debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,aes192-cbc,aes256-cbc
debug2: kex_parse_kexinit: hmac-sha1,hmac-sha1-96,hmac-md5,hmac-md5-96
debug2: kex_parse_kexinit: hmac-sha1,hmac-sha1-96,hmac-md5,hmac-md5-96
debug2: kex_parse_kexinit: none
debug2: kex_parse_kexinit: none
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: first_kex_follows 0 
debug2: kex_parse_kexinit: reserved 0 
debug2: mac_setup: found hmac-md5
debug1: kex: server->client aes128-cbc hmac-md5 none
debug2: mac_setup: found hmac-md5
debug1: kex: client->server aes128-cbc hmac-md5 none
debug2: dh_gen_key: priv key bits set: 130/256
debug2: bits set: 509/1024
debug1: sending SSH2_MSG_KEXDH_INIT
debug1: expecting SSH2_MSG_KEXDH_REPLY
debug1: Server host key: RSA 21:f7:7a:59:f5:ef:03:1f:ee:99:23:b8:f1:c1:71:b4
debug3: load_hostkeys: loading entries for host "clementine.duckdns.org" from file "/exports/home/se394/.ssh/known_hosts"
debug3: load_hostkeys: found key type RSA in file /exports/home/se394/.ssh/known_hosts:3
debug3: load_hostkeys: loaded 1 keys
debug3: load_hostkeys: loading entries for host "162.211.160.162" from file "/exports/home/se394/.ssh/known_hosts"
debug3: load_hostkeys: found key type RSA in file /exports/home/se394/.ssh/known_hosts:3
debug3: load_hostkeys: loaded 1 keys
debug1: Host 'clementine.duckdns.org' is known and matches the RSA host key.
debug1: Found key in /exports/home/se394/.ssh/known_hosts:3
debug2: bits set: 496/1024
debug1: ssh_rsa_verify: signature correct
debug2: kex_derive_keys
debug2: set_newkeys: mode 1
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug2: set_newkeys: mode 0
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug2: key: /exports/home/se394/.ssh/id_rsa (0x7f052168bf10),
debug2: key: /exports/home/se394/.ssh/id_dsa ((nil)),
debug2: key: /exports/home/se394/.ssh/id_ecdsa ((nil)),
debug1: Authentications that can continue: password
debug3: start over, passed a different list password
debug3: preferred gssapi-keyex,gssapi-with-mic,publickey,keyboard-interactive,password
debug3: authmethod_lookup password
debug3: remaining preferred: ,gssapi-with-mic,publickey,keyboard-interactive,password
debug3: authmethod_is_enabled password
debug1: Next authentication method: password
[email protected]'s password:

我检查了服务器上的 authorized_keys 文件,密钥与 id_rsa.pub 匹配。有人能提示一下下一步怎么做吗?

答案1

您不应该在没有配置的情况下重命名您的私钥文件(id_rsa),ssh以了解在搜索私钥时应该查找哪些其他文件名。

相关内容