오래전 이야기/Open Tools

ssh 인증키 사용방법(ssh2)

리눅스 엔지니어였던 2008. 9. 15. 17:54

1. Host Server


ssh-keygen -t rsa

Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
aa:bb:11:5a:6d:66:76:ee:e2:4c:9b:5d:3d:db:68:f5 root@$HOSTNAME

cd .ssh/

ls

scp id_rsa.pub $USER@$CLIENT_SERVER:.ssh/authorized_keys


2. Remote Server


chmod 755 ~/.ssh

chmod 644 .ssh/authorized_keys


1에서 2로 접속해보면 끝.