![SSH 서버는 1보다 먼저 사용할 키를 어떻게 정의합니까?](https://linux55.com/image/54932/SSH%20%EC%84%9C%EB%B2%84%EB%8A%94%201%EB%B3%B4%EB%8B%A4%20%EB%A8%BC%EC%A0%80%20%EC%82%AC%EC%9A%A9%ED%95%A0%20%ED%82%A4%EB%A5%BC%20%EC%96%B4%EB%96%BB%EA%B2%8C%20%EC%A0%95%EC%9D%98%ED%95%A9%EB%8B%88%EA%B9%8C%3F.png)
/etc/ssh
방금 내 Ubuntu 시스템의 디렉토리 에 더 많은 공개 키가 있다는 것을 발견했습니다 .
$ ll /etc/ssh
total 296K
-rw-r--r-- 1 root root 237K lip 3 2013 moduli
-rw-r--r-- 1 root root 1.7K kwi 17 12:43 ssh_config
-rw-r--r-- 1 root root 1.7K mar 25 23:06 ssh_config.dpkg-old
-rw-r--r-- 1 root root 1.7K kwi 17 12:43 ssh_config.lwidentity.bak
-rw-r--r-- 1 root root 1.7K mar 25 23:06 ssh_config.lwidentity.orig
-rw-r--r-- 1 root root 2.6K kwi 17 12:43 sshd_config
-rw-r--r-- 1 root root 2.6K kwi 17 12:43 sshd_config.lwidentity.bak
-rw-r--r-- 1 root root 2.5K mar 25 23:06 sshd_config.lwidentity.orig
-rw------- 1 root root 672 sty 4 2014 ssh_host_dsa_key
-rw-r--r-- 1 root root 605 sty 4 2014 ssh_host_dsa_key.pub
-rw------- 1 root root 227 sty 4 2014 ssh_host_ecdsa_key
-rw-r--r-- 1 root root 177 sty 4 2014 ssh_host_ecdsa_key.pub
-rw------- 1 root root 1.7K sty 4 2014 ssh_host_rsa_key
-rw-r--r-- 1 root root 397 sty 4 2014 ssh_host_rsa_key.pub
-rw-r--r-- 1 root root 338 kwi 17 12:36 ssh_import_id
이것으로:
$ find /etc/ssh ~/.ssh -name "*.pub" -exec ssh-keygen -l -f {} \;
256 da:f0:03:79:68:f8:04:b1:07:d8:8f:fe:3d:91:0e:aa root@icanseeyou (ECDSA)
2048 3f:d7:9f:68:1b:b3:1a:a9:47:5b:47:5b:27:88:8c:aa root@icanseeyou (RSA)
1024 7f:24:ca:0f:e3:84:8e:f9:1c:b3:49:d1:f4:39:a1:aa root@icanseeyou (DSA)
4096 ae:86:c9:88:36:36:37:2f:84:5b:83:b4:45:17:41:aa USER@icanseeyou (RSA)
나는 항상 ECDSA 키를 첫 번째 키(제공된 키)로 사용합니다.
$ ssh -p 222 USER@localhost
The authenticity of host '[localhost]:222 ([127.0.0.1]:222)' can't be established.
ECDSA key fingerprint is da:f0:03:79:68:f8:04:b1:07:d8:8f:fe:3d:91:0e:aa.
Are you sure you want to continue connecting (yes/no)?
/etc/ssh/sshd_config
11 HostKey /etc/ssh/ssh_host_rsa_key
12 HostKey /etc/ssh/ssh_host_dsa_key
13 HostKey /etc/ssh/ssh_host_ecdsa_key
어떻게 작동하나요? ECDSA 키가 가장 먼저 제공되는 이유는 무엇입니까?
답변1
코드를 본 적은 없지만 다음과 같습니다.
호스트 키를 처음 학습할 때는 ECDSA 호스트 키가 선호되거나 ssh-keyscan(1)을 사용하여 학습할 수 있습니다.