SSH : Permission denied (publickey)
터미널에서 ssh 를 이용하여 debian 이 설치된 원격 서버에 접근 하려고 하였다.
freecatz:~ $ ssh freecatz@192.168.0.10
Debian GNU/Linux 10 \n \l
freecatz@192.168.0.10: Permission denied (publickey).
freecatz:~ $
그러나 'Permission denied (publickey)' 에러가 나왔다. 서버측의 에러를 확인해 보자.
root@FREECATZ-PE-KR:~# tail /var/log/auth.log
... 중략 ...
Feb 4 02:47:15 FREECATZ-PE-KR sshd[948]: Connection closed by authenticating user freecatz 192.168.0.1 port 50913 [preauth]
이 문제를 해결 하기 위해 ssh 설정 파일을 수정 한다.
root@FREECATZ-PE-KR:~# vi /etc/ssh/sshd_config
#PasswordAuthentication no PasswordAuthentication yes |
PasswordAuthentication 항목의 값이 'no' 로 설정되어 있다면, 'yes' 로 변경 하여 주고, ssh 를 다시 시작 한다.
root@FREECATZ-PE-KR:~# /etc/init.d/ssh restart
[ ok ] Restarting ssh (via systemctl): ssh.service.
이제 클라이언트의 터미널에서 ssh로 연결을 시도해 본다.
freecatz:~ $ ssh freecatz@192.168.0.10
Debian GNU/Linux 10 \n \l
freecatz@192.168.0.10's password:
Linux FREECATZ-PE-KR 4.19.0-18-cloud-amd64 #1 SMP Debian 4.19.208-1 (2021-09-29) x86_64
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Fri Feb 4 02:50:06 2022 from 10.30.20.244
freecatz@FREECATZ-PE-KR:~$
정상적으로 접근 된다.