bypass password ssh di Linux
=========================================
[root@localhost .ssh]#chmod 700 ~/.ssh
[root@localhost .ssh]# ssh-keygen
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:
f4:a9:4d:e9:67:3d:80:9a:9f:cb:92:c6:54:c4:ad:df root@localhost.localdomain
The key’s randomart image is:
+–[ RSA 2048]—-+
| . . |
| o . |
| .. . |
| . .o+ |
| S.*… |
| .B .oE |
| o+.o o o |
| =o + . |
| . .=. |
+—————–+
[root@localhost .ssh]#
[root@localhost .ssh]# ls -al
total 20
drwx——. 2 root root 4096 Jul 10 10:46 .
dr-xr-x—. 3 root root 4096 Jul 10 09:01 ..
-rw——-. 1 root root 1671 Jul 10 10:46 id_rsa
-rw-r–r–. 1 root root 408 Jul 10 10:46 id_rsa.pub
[root@localhost .ssh]# ssh-copy-id -i id_rsa.pub root@192.168.122.2 — 192.168.122.2 is ip remote host
root@192.168.122.2's password:
Now try logging into the machine, with “ssh ‘root@192.168.122.2'”, and check in:
.ssh/authorized_keys
to make sure we haven’t added extra keys that you weren’t expecting.
[root@localhost .ssh]#
Now open your remote host :
[root@Server .ssh]# ls -al
total 16
drwx——. 2 root root 4096 Jul 10 10:49 .
dr-xr-x—. 22 root root 4096 Jul 10 08:49 ..
-rw——-. 1 root root 408 Jul 10 10:49 authorized_keys
[root@localhost .ssh]# ssh 192.168.122.2
Last login: Wed Jul 10 10:52:22 2013 from 192.168.122.3
[root@Server ~]# date
Wed Jul 10 10:52:41 WIT 2013
[root@Server ~]#
Tidak ada komentar:
Posting Komentar