2009/08/08 08:28
패스워드 입력없이 ssh 로그인 하기 Linux2009/08/08 08:28
rhel5a 시스템의 testuser 계정으로 rhel5b 시스템의 testuser1 계정으로 ssh 로 로그인 하는데 패스워드 입력없이 로그인 하는 방법.
1. rhel5a 에서 키생성 (그냥 엔터키만 누르고 진행)
[testuser@rhel5a ~]$ ssh-keygen -t dsa
Generating public/private dsa key pair.
Enter file in which to save the key (/home/testuser/.ssh/id_dsa):
Created directory '/home/testuser/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/testuser/.ssh/id_dsa.
Your public key has been saved in /home/testuser/.ssh/id_dsa.pub.
The key fingerprint is:
4d:bd:bc:b9:92:bf:eb:22:a8:5a:af:14:de:41:ad:a2 testuser@rhel5a
2. rhel5b의 testuser1 계정으로 키 복사
[testuser@rhel5a ~]$ ssh-copy-id -i .ssh/id_dsa.pub testuser1@rhel5b
15
The authenticity of host 'rhel5b (192.168.123.121)' can't be established.
RSA key fingerprint is 02:c1:b0:19:9e:10:0f:00:f9:a2:95:9e:3b:60:3e:d4.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'rhel5b,192.168.123.121' (RSA) to the list of known hosts.
testuser1@rhel5b's password:
Now try logging into the machine, with "ssh 'testuser1@rhel5b'", and check in:
.ssh/authorized_keys
to make sure we haven't added extra keys that you weren't expecting.
3. 원격 접속 확인
[testuser@rhel5a ~]$ ssh testuser1@rhel5b
Last login: Sat Aug 8 08:19:14 2009 from rhel5a
