SSH는 ssh-copy-id 다음에 비밀번호를 묻습니다.

SSH는 ssh-copy-id 다음에 비밀번호를 묻습니다.

ssh-keygen을 사용하여 내 컴퓨터에 키를 만들었습니다. ssh-copy-id를 사용하여 키를 원격 시스템에 복사합니다.

원격 컴퓨터에 연결을 시도했지만 비밀번호를 묻습니다. 두 머신 모두 우분투입니다(로컬 11.04, 원격 8.04).

편집(추가 자세한 출력 포함)

SSH의 세부 정보는 다음과 같습니다.

    OpenSSH_5.8p1 Debian-1ubuntu3, OpenSSL 0.9.8o 01 Jun 2010
debug1: Reading configuration data /home/leandro/.ssh/config
debug1: Applying options for *
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to 192.168.1.217 [192.168.1.217] port 22.
debug1: Connection established.
debug3: Incorrect RSA1 identifier
debug3: Could not load "/home/leandro/.ssh/id_rsa" as a RSA1 public key
debug2: key_type_from_name: unknown key type '-----BEGIN'
debug3: key_read: missing keytype
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug2: key_type_from_name: unknown key type '-----END'
debug3: key_read: missing keytype
debug1: identity file /home/leandro/.ssh/id_rsa type 1
debug1: Checking blacklist file /usr/share/ssh/blacklist.RSA-2048
debug1: Checking blacklist file /etc/ssh/blacklist.RSA-2048
debug1: identity file /home/leandro/.ssh/id_rsa-cert type -1
debug1: identity file /home/leandro/.ssh/id_dsa type -1
debug1: identity file /home/leandro/.ssh/id_dsa-cert type -1
debug1: identity file /home/leandro/.ssh/id_ecdsa type -1
debug1: identity file /home/leandro/.ssh/id_ecdsa-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_4.7p1 Debian-8ubuntu1
debug1: match: OpenSSH_4.7p1 Debian-8ubuntu1 pat OpenSSH_4*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.8p1 Debian-1ubuntu3
debug2: fd 3 setting O_NONBLOCK
debug3: load_hostkeys: loading entries for host "192.168.1.217" from file "/home/leandro/.ssh/known_hosts"
debug3: load_hostkeys: found key type RSA in file /home/leandro/.ssh/known_hosts:6
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,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,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected]
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,[email protected],hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,[email protected],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-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: ssh-rsa,ssh-dss
debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour128,arcfour256,arcfour,aes192-cbc,aes256-cbc,[email protected],aes128-ctr,aes192-ctr,aes256-ctr
debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour128,arcfour256,arcfour,aes192-cbc,aes256-cbc,[email protected],aes128-ctr,aes192-ctr,aes256-ctr
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,[email protected],hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,[email protected],hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,[email protected]
debug2: kex_parse_kexinit: none,[email protected]
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-ctr hmac-md5 none
debug2: mac_setup: found hmac-md5
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
debug2: dh_gen_key: priv key bits set: 132/256
debug2: bits set: 527/1024
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Server host key: RSA 72:d5:e9:a2:09:46:e5:f2:e9:65:39:56:ba:f8:bc:38
debug3: load_hostkeys: loading entries for host "192.168.1.217" from file "/home/leandro/.ssh/known_hosts"
debug3: load_hostkeys: found key type RSA in file /home/leandro/.ssh/known_hosts:6
debug3: load_hostkeys: loaded 1 keys
debug1: Host '192.168.1.217' is known and matches the RSA host key.
debug1: Found key in /home/leandro/.ssh/known_hosts:6
debug2: bits set: 555/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: /home/leandro/.ssh/id_rsa (0x21ef1040)
debug2: key: /home/leandro/.ssh/id_dsa ((nil))
debug2: key: /home/leandro/.ssh/id_ecdsa ((nil))
debug1: Authentications that can continue: publickey,password
debug3: start over, passed a different list publickey,password
debug3: preferred gssapi-keyex,gssapi-with-mic,publickey,keyboard-interactive,password
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/leandro/.ssh/id_rsa
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey,password
debug1: Trying private key: /home/leandro/.ssh/id_dsa
debug3: no such identity: /home/leandro/.ssh/id_dsa
debug1: Trying private key: /home/leandro/.ssh/id_ecdsa
debug3: no such identity: /home/leandro/.ssh/id_ecdsa
debug2: we did not send a packet, disable method
debug3: authmethod_lookup password
debug3: remaining preferred: ,password
debug3: authmethod_is_enabled password
debug1: Next authentication method: password
[email protected]'s password: 

leandro@FiberWork72:~$ cd ~/.ssh/
leandro@FiberWork72:~/.ssh$ ls
config  id_rsa  id_rsa.pub  known_hosts  known_hosts.bkp  known_hosts.old

편집하다:

좋아요 나는 여기서 뭔가를 발견했습니다. 나는 ~/.ssh/authorized_keys를 보고 있었고 키 끝에 다음과 같은 내용이 있다는 것을 깨달았습니다.

me@my_computer_name 

바꾸다:

me@my_computer_ip

이것이 그것과 관련이 있는지는 모르겠습니다만...

답변1

이것태그 위키ssh몇 가지 기본적인 문제에 대한 좋은 정보와 해결 방법이 있습니다.

내 첫 번째 추측은 권한을 확인 ~/.ssh하고 귀하를 제외한 다른 사용자가 쓸 수 없는지 확인하는 것입니다. 이에 대해 더 자세히 읽을 수 있습니다.여기.

답변2

키 이름이 id_rsa, id_dsa 또는 id_ecdsa와 다른가요?

기본적으로 ssh는 이러한 키 이름만 사용하려고 시도합니다. 다른 이름을 선택하는 경우 걱정하지 마세요. -i를 사용하여 키 이름을 지정하거나 ~ssh/config 파일에서 한 번에 모두 지정할 수 있습니다.

-i를 사용하는 예(키 이름 앞에 ~/.ssh/를 추가해야 할 수도 있지만 기억이 나지 않습니다):

ssh -i <your_priv_key_name> [email protected]

~/.ssh/config 예

Host 192.168.1.217
  IdentityFile ~/.ssh/<your_priv_key_name>

답변3

"myuser"가 원격 시스템의 유효한 사용자라고 가정하면 해당 사용자의 ~/.ssh/authorized_keys에 키를 배치해야 합니다(기본 구성을 사용하는 경우).

원격 서버의 sshd_config를 확인하여 authkey 파일이 올바른지 확인하고 행을 찾으십시오 AuthorizedKeysFile.

관련 정보