MacOS Sierra에서 SSH 키 암호를 계속 물어볼 때

  • Post author:
  • Post category:칼럼
  • Post comments:0 Comments
  • Post last modified:December 4, 2023

언제부터인지 블로그 서버에 접속할 때마다 ssh passphrase를 묻더라. 한두 번은 그러려니 하고 넘어갔는데 점점 귀찮아져서 문제 해결책을 찾아보았다.

일반적인 조언은 ssh-add -K 명령을 이용하라는 것이다.

ssh-add -K /path/to/private/key

하지만 이걸로 문제가 해결됐으면 이런 글도 안 썼겠지. ~/.ssh/config 파일에

Host *
  AddKeysToAgent yes 

이렇게 설정을 넣으라 하는데 이 또한 소용이 없더라. 그래서 검색을 하고 또 검색을 해서 찾은 해결책!

Host *
   UseKeychain yes
   AddKeysToAgent yes

AddKeysToAgentUseKeychain조합하니까 키체인에 저장한 ssh passphrase를 이용해 바로 서버에 접속하게 됐다.

참고로 UseKeychain은 Sierra에서 처음 들어온 키워드이고 당연히 Sierra 전용이라 리눅스 또는 이전 버전의 Mac OS X에서는 쓰지 못하는 키워드이다.

UseKeychain
On macOS, specifies whether the system should search for passphrases in the user’s keychain when attempting to use a particular key. When the passphrase is provided by the user, this option also specifies whether the passphrase should be stored into the keychain once it has been verified to be correct. The argument must be ”yes” or ”no”. The default is “no”.

참고 자료

Author Details
Kubernetes, DevSecOps, AWS, 클라우드 보안, 클라우드 비용관리, SaaS 의 활용과 내재화 등 소프트웨어 개발 전반에 도움이 필요하다면 도움을 요청하세요. 지인이라면 가볍게 도와드리겠습니다. 전문적인 도움이 필요하다면 저의 현업에 방해가 되지 않는 선에서 협의가능합니다.
0 0 votes
Article Rating
Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Inline Feedbacks
View all comments