Archlinux의 비밀번호 없는 ssh(ssh-copy-id 이후에도 여전히 비밀번호를 묻는 메시지가 표시됨)

Archlinux의 비밀번호 없는 ssh(ssh-copy-id 이후에도 여전히 비밀번호를 묻는 메시지가 표시됨)

우분투/민트에서 비밀번호 없는 SSH 로그인을 위해 해야 할 일은 다음과 같습니다:

ssh-keygen -t rsa # on both pc
ssh-copy-id targetpc
ssh targetpc # does not prompt from password anymore

그게 다야..

나는 Archlinux(또는 manjaro)에서 동일한 작업을 수행했지만 세 번째 단계에서는 작동하지 않았고 여전히 암호를 묻는 메시지가 나타납니다.

debug1: Reading configuration data /home/blablabla/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Connecting to 192.168.11.3 [192.168.11.3] port 22.
debug1: Connection established.
debug1: identity file /home/blablabla/.ssh/id_rsa type 1
debug1: identity file /home/blablabla/.ssh/id_rsa-cert type -1
debug1: identity file /home/blablabla/.ssh/id_dsa type 2
debug1: identity file /home/blablabla/.ssh/id_dsa-cert type -1
debug1: identity file /home/blablabla/.ssh/id_ecdsa type 3
debug1: identity file /home/blablabla/.ssh/id_ecdsa-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.2
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.1
debug1: match: OpenSSH_6.1 pat OpenSSH*
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client arcfour hmac-md5 [email protected]
debug1: kex: client->server arcfour hmac-md5 [email protected]
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ECDSA 71:d2:05:dd:21:d1:ae:fc:a8:e5:f2:1c:2c:60:31:85
debug1: Host '192.168.11.3' is known and matches the ECDSA host key.
debug1: Found key in /home/blablabla/.ssh/known_hosts:11
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/blablabla/.ssh/id_rsa
debug1: Authentications that can continue: publickey,password
debug1: Offering DSA public key: /home/blablabla/.ssh/id_dsa
debug1: Authentications that can continue: publickey,password
debug1: Offering ECDSA public key: /home/blablabla/.ssh/id_ecdsa
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: password

이전 홈 디렉토리(우분투에서)를 사용할 때 ssh-copy-id는 이전에 본 적이 없는 일부 정보를 표시합니다.

/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys

Archlinux에서 수행해야 할 누락된 몇 가지 단계가 있습니까?

편집: 두 시스템의 openssh 버전이 다릅니다. 하나는 6.1p1-6이고 다른 하나는 6.2p1-1입니다.

답변1

일반적으로 이는 홈 디렉터리 또는 .ssh/ 디렉터리에 올바른 권한이 없음을 의미합니다. sshd의 오류가 있는지 원격 측의 시스템 로그를 확인하세요.

예를 들어 다음을 포함하는 줄입니다.

sshd[pid]: Authentication refused: bad ownership or modes for directory /home/yourusername

존재하다

/var/log/auth.log

해야 한다는 뜻이다

chmod 700 ~

관련 정보