Create ssh-key
[root@localhost ]# ssh-keygen -t rsa

Copy to authorized_keys
[root@localhost ]# cp -a ~/.ssh/ ~/.ssh/authorized_keys
[root@localhost ]# ls -l ~/.ssh/
total 16
-rw-r--r-- 1 root root  408 Jun  4 16:44 authorized_keys
-rw------- 1 root root 1675 Jun  4 16:43 id_rsa
-rw-r--r-- 1 root root  408 Jun  4 16:43
-rw-r--r-- 1 root root  391 Jun  4 16:44 known_hosts

password-less ssh login test
[root@localhost ]# ssh localhost
Warning: Permanently added 'localhost' (RSA) to the list of known hosts.
root@localhost's password:

check like this
[root@localhost ]# stat -c "%a %u %g" /root
550 0 0
This value is correct information

if different value then can login with password-less ssh. (For root account)
permission is 775, 777 or 755 ...
owner is application or normal user account

permission and owner is different then can’t login to root account with ssh-key

[root@localhost ]# chmod 550 /root
[root@localhost ]# chown root:root -R /root

Then will be works.
크리에이티브 커먼즈 라이센스
Creative Commons License
받은 트랙백이 없고, 댓글이 없습니다.

댓글+트랙백 RSS ::

댓글+트랙백 ATOM ::