문서의 선택한 두 판 사이의 차이를 보여줍니다.
양쪽 이전 판 이전 판 다음 판 | 이전 판 | ||
linux:ssh [2019/11/13 23:07] kwon37xi |
linux:ssh [2023/01/30 17:19] kwon37xi [no matching cipher found.] |
||
---|---|---|---|
줄 5: | 줄 5: | ||
* [[http:// | * [[http:// | ||
* [[http:// | * [[http:// | ||
+ | * [[linux: | ||
* [[linux: | * [[linux: | ||
* [[linux: | * [[linux: | ||
+ | * [[: | ||
+ | * [[linux: | ||
+ | * [[linux: | ||
+ | * [[linux: | ||
===== Private Key 생성 ===== | ===== Private Key 생성 ===== | ||
<code sh> | <code sh> | ||
- | ssh-keygen -t rsa | + | ssh-keygen -t rsa -b 4096 -m pem -C " |
</ | </ | ||
* Passphrase를 항상 넣는 것이 좋다. | * Passphrase를 항상 넣는 것이 좋다. | ||
* '' | * '' | ||
* '' | * '' | ||
+ | * [[git: | ||
+ | * '' | ||
+ | * [[: | ||
* '' | * '' | ||
chmod 700 ~/.ssh | chmod 700 ~/.ssh | ||
+ | </ | ||
+ | |||
+ | ==== 서버의 '' | ||
+ | * [[https:// | ||
+ | |||
+ | <code sh> | ||
+ | ssh-copy-id -f -i id_rsa.pub username@host | ||
</ | </ | ||
줄 32: | 줄 47: | ||
</ | </ | ||
* [[https:// | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[linux: | ||
+ | ===== ssh-agent forwarding ===== | ||
+ | * local PC 에 원격 서버의 private key 를 두고, 이를 bastion 서버에 그대로 포워딩해주고, | ||
+ | * 이렇게 하면 공용 bastion 서버에 private key를 두지 않기 때문에 좀 더 안전해진다. | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * '' | ||
===== SSH 접속 인사 텍스트 ===== | ===== SSH 접속 인사 텍스트 ===== | ||
* ''/ | * ''/ | ||
줄 77: | 줄 102: | ||
* [[https:// | * [[https:// | ||
* [[https:// | * [[https:// | ||
+ | * '' | ||
+ | * [[https:// | ||
+ | * '' | ||
===== 접속 유지 Keep connection ===== | ===== 접속 유지 Keep connection ===== | ||
줄 151: | 줄 179: | ||
===== known_hosts 에 미리 호스트 추가 ===== | ===== known_hosts 에 미리 호스트 추가 ===== | ||
- | [[http:// | + | * [[http:// |
+ | * [[https:// | ||
+ | * [[https:// | ||
<code sh> | <code sh> | ||
ssh-keyscan -t rsa host명 >> ~/ | ssh-keyscan -t rsa host명 >> ~/ | ||
줄 162: | 줄 192: | ||
>> no matching cipher found. Their offer: aes128-cbc, | >> no matching cipher found. Their offer: aes128-cbc, | ||
- | '' | + | 혹은 |
+ | >> no matching key exchange method found. Their offer: diffie-hellman-group-exchange-sha1, | ||
+ | |||
+ | |||
+ | '' | ||
< | < | ||
Ciphers aes128-cbc, | Ciphers aes128-cbc, | ||
# 필요한 경우 | # 필요한 경우 | ||
KexAlgorithms +diffie-hellman-group1-sha1 | KexAlgorithms +diffie-hellman-group1-sha1 | ||
+ | |||
+ | # Host 를 명시해서 설정하는게 나음 | ||
+ | Host 123.123.123.123 | ||
+ | KexAlgorithms +diffie-hellman-group1-sha1 | ||
+ | | ||
</ | </ | ||
줄 174: | 줄 213: | ||
ssh -c aes128-cbc kwon37xi@xxx.xx.xx.xx | ssh -c aes128-cbc kwon37xi@xxx.xx.xx.xx | ||
</ | </ | ||
+ | |||
+ | ===== no match host key type found ===== | ||
+ | * 아래와 같은 형태의 메시지가 나온다면, | ||
+ | < | ||
+ | Unable to negotiate with 192.168.1.1 port 22: no matching host key type found. Their offer: ssh-dss, ssh-rsa | ||
+ | </ | ||
+ | * 위에서와 같이 전역으로 혹은 특정 '' | ||
+ | <code sh> | ||
+ | |||
+ | HostkeyAlgorithms ssh-dss, | ||
+ | </ | ||
+ | ===== SSH Pipe ===== | ||
+ | * [[https:// | ||
+ | |||
+ | ===== SSH RSA private key 를 공유해도 괜찮은가? | ||
+ | * [[https:// | ||
+ | * **강력한 비밀번호로 passphrase를 걸었다면** 괜찮지만, | ||
+ | |||
+ | |||
+ | ===== 참조 ===== | ||
+ | * [[https:// | ||