sshd가 존재하지 않는 공개 키 파일을 보는 이유는 무엇입니까?

sshd가 존재하지 않는 공개 키 파일을 보는 이유는 무엇입니까?

SSH 키를 작동시키려는 노력의 일환으로 sshd 인증 로그를 추적하고 있는데 다음 줄이 표시됩니다.

debug1: test whether pkalg/pkblob are acceptable
debug1: temporarily_use_uid: 10144/10029 (e=0/0)
debug1: trying public key file /home/cklein/.ssh/authorized_keys
debug1: restore_uid: 0/0
debug1: temporarily_use_uid: 10144/10029 (e=0/0)
debug1: trying public key file /home/cklein/.ssh/authorized_keys2
debug1: restore_uid: 0/0
Failed publickey for cklein from 192.168.8.165 port 46583 ssh2

하지만 디렉토리를 확인해 보면 /home/cklein/.ssh/다음과 같습니다.

$ ls -al /home/cklein/.ssh/
total 16
drwx------. 2 cklein infoarch 4096 May  3 16:39 .
drwxr-x--x. 9 cklein infoarch 4096 May  3 16:39 ..
-rw-------. 1 cklein infoarch  605 May  3 16:39 authorized_keys
-rw-r--r--. 1 cklein infoarch  226 Apr  4 16:11 known_hosts

해당 디렉토리에 파일이 있었지만 authorized_keys2제거하고 이후 sshd. 왜 여전히 해당 파일이 존재할 것으로 예상합니까?

또한 공개 키가 거부되는 이유에 대해 추측할 수 있습니까?

답변1

기본적으로 OpenSSH 서버는 의 구성 파일에 다른 값을 설정하지 않는 한 .ssh/authorized_keys및 에서 승인된 키를 찾습니다 ..ssh/authorized_keys2AuthorizedKeysFile/etc/ssh/sshd_config

나머지는 디렉터리 목록에서 키 파일을 볼 수 없습니다. 명령 을 사용하여 생성했습니까 ssh-keygen?

관련 정보