ssh login without password ¶
- ì°¸ê³ ê¸€
- 구글ì—�서 ì–´ë–¤ 검색 키워드를 ë„£ëŠ�ëƒ�ì—� ë”°ë�¼ì„œ 삽질ì�„ 하ë�˜ì§€ 바로 해결하ë�˜ì§€ 한다는 것ì�„ 알았ì�Œ. 위 검색 키워드로 찾아 가면 위 ì°¸ê³ ê¸€ì�´ 나오는ë�° 똑같ì�´ í•´ë�„ 안ë� 가능성ì�´ 높ì�Œ.
A : Client
B : Server
아래 ëª…ë ¹ì–´ 실행시ì—� Enter Passphrase ì—�서 그냥 Enter ë§Œ ì¹ ê²ƒ
a@A:~> ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/a/.ssh/id_rsa):
Created directory '/home/a/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/a/.ssh/id_rsa.
Your public key has been saved in /home/a/.ssh/id_rsa.pub.
The key fingerprint is:
3e:4f:05:79:3a:9f:96:7c:3b:ad:e9:58:37:bc:37:e4 a@A
a@A:~> ssh b@B mkdir -p .ssh
b@localhost's password:
a@A:~> cat .ssh/id_rsa.pub | ssh b@B 'cat >> .ssh/authorized_keys'
b@B's password:
ssh b@B chmod 700 .ssh/
ssh b@B chmod 600 .ssh/authorized_keys
ê°œë…� ì�´í•´ ¶
- Aì—�서 B 서버로 ì ‘ì†�하기 위해서 는 A ì—�서 private_key ì�¸ id_rsa ê°€ ê¼ ìžˆì–´ì•¼ í•˜ê³ , ì�´ê²ƒì�˜ public_key ê°€ 해당 B 서버ì�˜ authorized_keys 안ì—� 추가ë�˜ì–´ 있어야 한다. authorized_keys 안ì—�는 여러개를 ë„£ì�„ 수 있다.









