
공개 및 개인 키 인증에 문제가 있습니다. 이 단계를 수행하면 공개 키 기반이 작동하지 않습니다. 1- 다음 명령을 사용하여 개인 키와 공개 키(RSA) 쌍을 생성합니다.
Generating public/private rsa key pair.
Enter file in which to save the key (/home/rc_ss/.ssh/id_rsa):
Created directory '/home/rc_ss/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/rc_ss/.ssh/id_rsa.
Your public key has been saved in /home/rc_ss/.ssh/id_rsa.pub.
The key fingerprint is:
ac:fd:d1:2e:e5:1e:db:87:98:77:9e:14:62:db:97:f0 rc_ss@rc_ss-network
The key's randomart image is:
+--[ RSA 2048]----+
| |
| |
| |
| . |
| S + . |
| o .o * o|
| . . .oo+ E.|
| ..o+++ =|
| .o+..=.|
+-----------------+
2- 다음과 같이 ssh-copy-id를 사용하여 네트워크를 통해 복사합니다.
rc_ss@rc_ss-network:~$ ssh-copy-id -i .ssh/id_rsa.pub [email protected]
The authenticity of host '192.168.2.100 (192.168.2.100)' can't be established.
ECDSA key fingerprint is 33:67:e0:02:b1:10:46:76:78:6b:1f:e2:55:9b:6a:a8.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.2.100' (ECDSA) to the list of known hosts.
[email protected]'s password:
Now try logging into the machine, with "ssh '[email protected]'", and check in:
~/.ssh/authorized_keys
to make sure we haven't added extra keys that you weren't expecting.
3- 그런 다음 비밀번호 없이 SSH 서버에 연결하고 다음을 처리하고 싶습니다.
rc_ss@rc_ss-network:~$ ssh [email protected]
[email protected]'s password:
이는 아직 비밀번호가 필요하다는 의미입니다. 누구든지 나를 도와줄 수 있나요? 감사합니다.
답변1
공개 키가 대상 서버에 올바르게 복사되었다고 가정하면 SSH 데몬이 비밀번호 없는 로그인을 지원하는지 확인해야 합니다. 이 구성은 파일에 설정되어 /etc/ssh/sshd_config
있으며 다음 값이 설정되어 있는지 확인해야 합니다.
PermitRootLogin yes
RSAAuthentication yes
PubkeyAuthentication yes
해당 값이 설정되지 않은 경우 해당 값을 설정한 다음 sudo service ssh restart
터미널에서 SSH를 다시 시작해야 합니다.