HP-UX SSH Password 없이 login 하기
IT,PC,모바일,스마트폰 정보와 팁 그리고 제품리뷰와 생활정보
HP-UX SSH Password 없이 login 하기
2011. 2. 22. 14:53
HP-UX 에서 ssh 를 사용하요 password 없이 바로 login 하는 방법입니다.
[user@host1:/home/user/.ssh]$ ll
[user@host1:/home/user]$ cat id_dsa.pub
ssh-dss AAAAB3NzaC1kc3MAAACBAPULoMWZDawocVlpSWHYVXMPS++97/RqHej2DKGkfefAI+eVJxXXi6HI1jcwkBkcYBRmI+e6md0
HP-UX 에서도 OpenSSH 를 사용 합니다.. ㅎㅎ
일반적으로 ssh 를 사용을 하게 되면 암호화된 password 를 사용하거나 , RSA, DSA Key 를 사용하여 Login 을 하게 됩니다.
Password 없이 Login 을 하기 위해서는 RSA, DSA Key 를 사용 하게 됩니다.
RSA 는 SSH1 을 지원하고 DSA 는 SSH2 를 지원 합니다.
1. RSA Key 사용
[user@host1:/home/user]$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Please be patient.... Key generation may take a few minutes
Enter file in which to save the key (/home/user/.ssh/id_rsa): <- Key 경로 (그냥 엔터)
Enter passphrase (empty for no passphrase): <- Key Password ( 그냥 엔터)
Enter same passphrase again: <- Key Password 확인 (그냥 엔터)
Your identification has been saved in /home/user/.ssh/id_rsa.
Your public key has been saved in /home/user/.ssh/id_rsa.pub.
The key fingerprint is:
c8:66:a6:6b:7b:4b:5b:6c:95:8b:b1:e6:45:ac:62:bb user@uctmpdb1
The key's randomart image is:
+--[ RSA 2048]----+
| |
| |
| |
| . . . . |
| * S = |
| = . B . |
| . + O o |
| .+.O . |
| .ooEo. |
+-----------------+
[user@host1:/home/user/.ssh]$ ll
-rw------- 1 inf03217 wheel 1679 2월 22일 14:37 id_rsa
-rw-r--r-- 1 inf03217 wheel 399 2월 22일 14:37 id_rsa.pub
[user@host1:/home/user/.ssh]$ cat id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EADDDDDAQABAAABAQCsoULSGD5oDC67OsHfZJ5ohAsR1bQxA7mhMRHW5p77wY3+F4jivB8RdgaDWPFmaxRvirEKvYmgd47dk7deHnFFAdJfPZIgtubLVaBOnldbHh49BUOOrcVJyjmOv8RRIX6b5dUefikCpxG2IfU2qetuAM4fWX9XrvQ1bUw7xLm1yr077VmI3K36w+ZFPxtr21Cr2dZRxpiqBlXdE+Se2S8254o9VZbMd0O56ice3IQQYDOMdi1+a7IK3rgJ98EFke6m5aEUJdHTIXohVef9Jq2cv4O7CwTGcusRww2hJZy5io4MFtRNvX9cT4zPPDloQko20ImTxL7TNtrLsW+JSZmV user@host1
ssh-keygen 으로 RSA Private Key, Public Key 를 생성 합니다.
생성한 Public Key 를 원격 호스트에 복사해 놓으시면 끝!!
[user2@host2:/home/user/.ssh]$ vi authorized_keys
AAAAB3NzaC1yc2EADDDDDAQABAAABAQCsoULSGD5oDC67OsHfZJ5ohAsR1bQxA7mhMRHW5p77wY3+F4jivB8RdgaDWPFmaxRvirEKvYmgd47dk7deHnFFAdJfPZIgtubLVaBOnldbHh49BUOOrcVJyjmOv8RRIX6b5dUefikCpxG2IfU2qetuAM4fWX9XrvQ1bUw7xLm1yr077VmI3K36w+ZFPxtr21Cr2dZRxpiqBlXdE+Se2S8254o9VZbMd0O56ice3IQQYDOMdi1+a7IK3rgJ98EFke6m5aEUJdHTIXohVef9Jq2cv4O7CwTGcusRww2hJZy5io4MFtRNvX9cT4zPPDloQko20ImTxL7TNtrLsW+JSZmV user@host1
AAAAB3NzaC1yc2EADDDDDAQABAAABAQCsoULSGD5oDC67OsHfZJ5ohAsR1bQxA7mhMRHW5p77wY3+F4jivB8RdgaDWPFmaxRvirEKvYmgd47dk7deHnFFAdJfPZIgtubLVaBOnldbHh49BUOOrcVJyjmOv8RRIX6b5dUefikCpxG2IfU2qetuAM4fWX9XrvQ1bUw7xLm1yr077VmI3K36w+ZFPxtr21Cr2dZRxpiqBlXdE+Se2S8254o9VZbMd0O56ice3IQQYDOMdi1+a7IK3rgJ98EFke6m5aEUJdHTIXohVef9Jq2cv4O7CwTGcusRww2hJZy5io4MFtRNvX9cT4zPPDloQko20ImTxL7TNtrLsW+JSZmV user@host1
이제 원격 호스트로 접속을 하게 되면 Password 없이 로그인이 가능 합니다..
2. DSA Key 사용
[user@host1:/home/user]$ ssh-keygen -t dsa
Generating public/private dsa key pair.
Enter file in which to save the key (/home/user/.ssh/id_dsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/user/.ssh/id_dsa.
Your public key has been saved in /home/user/.ssh/id_dsa.pub.
The key fingerprint is:
91:89:ad:7a:d3:21:cc:ac:f8:7a:65:d2:53:44:8a:38 user@uctmpdb1
The key's randomart image is:
+--[ DSA 1024]----+
| .. |
| . . +.o |
| E . o.= |
| . + ... |
| .*.S |
| ..o=o . |
| . o+o.. |
| ... . |
| .o. |
+-----------------+
[user@host1:/home/user]$ cat id_dsa.pub
ssh-dss AAAAB3NzaC1kc3MAAACBAPULoMWZDawocVlpSWHYVXMPS++97/RqHej2DKGkfefAI+eVJxXXi6HI1jcwkBkcYBRmI+e6md0
JM+I/Gi0i+CYpnhIl/b409GsJiIdddpBBvmy2m7ablOW9aCBemL30qOqD9Mes6/Bnrctb+fFQbRwWzU1O8mahZLIK46UBZCtcNAA
AAFQC4W2skte1cK3YDBrXvbohnsCj+HQAAAIEA68YpP1T9ybUYbcnepShO8wetAzjrfC2718GbZIt3NJALqSdgnQZBLKKr1v2L
gvOyCak86b8MuTFbvSaCezvSe2Py2bTkCti1RBdNIwUOBAqCTYBzjL8mrHSZBIRXGsOczVh78cHjAFHAeM0he9nHcqJDXtB
iYJh0CgpPbkqQ9oIAAACAJle0NVZoEuXrTw9Yi80x7Eq9a9CW/f1Q6m46x7Bz3bvQCrpW8vT1eHdPwynY8vnrxOw6JFYXCi/o/
L5wSn11CW28pelWg632syHAnLUgDOyEScv6TTuIv58VWnA63TvX8YMy+dRoIgF11VgSnMU4WS3noSc3bLcGCarZsndAuAM
= user@host1
방법은 RSA 와 동일 합니다.. 이제 원격 host 에 Public Key 를 복사해 넣으면 됩니다.
[user2@host2:/home/user/.ssh]$ vi authorized_keys2
Skin By KEBIBLOG Ver 1.0 Copyright ⓒ KEBI BLOG. All rights reserved.