1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# User는 Public-key를 만든다. # 난 이미 있으므로 아래와 같이 나오지만, 그냥 enter를 치면 된다. $ ssh-keygen -t rsa Enter file in which to save the key (/your/homepath/.ssh/id_rsa): /your/homepath/.ssh/id_rsa already exists. Overwrite (y/n)? y Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /your/homepath/.ssh/id_rsa. Your public key has been saved in /your/homepath/.ssh/id_rsa.pub. The key fingerprint is: b9:31:7a:72:16:f0:39:90:cb:d2:70:d4:bb:35:8e:cf youraccount@your-server The key's randomart image is: +--[ RSA 2048]----+ | .. | | . .. | | . = . | | = =.oo | | . + S= . | | . .o*. | | o =o | | = E | | | +-----------------+ # /your/homepath/.ssh path에 # id_rsa 와 id_rsa.pub 두 파일이 생성 된다. # id_rsa.pub 의 내부 내용을 접속하고자 하는 서버 접속자에게 전달 한다. # 상대편은 자신의 계정 /anotheruser/homepath/.ssh/authorized_keys (없다면 생성) 에 # 전달 받은 id_rsa.pub 의 내용을 넣는다. $ cat id_rsa.pub >> authorized_keys # 접속 확인 # 예, user1의 계정으로 user2의 계정으로 svr1 -> srv2 로 접속 $ ssh user2@svr2 => passwd 없이 접속이 되는지 확인 |