kagyuu@grape:~> ssh-keygen -t rsa Generating public/private rsa key pair. Enter file in which to save the key (/home/kagyuu/.ssh/id_rsa): Created directory '/home/kagyuu/.ssh'. Enter passphrase (empty for no passphrase):********** Enter same passphrase again:********** Your identification has been saved in /home/kagyuu/.ssh/id_rsa. Your public key has been saved in /home/kagyuu/.ssh/id_rsa.pub. The key fingerprint is: db:96:d9:00:6d:0b:b2:ae:d1:54:77:f4:75:4a:1d:4c kagyuu@grape kagyuu@grape:~>
/.ssh に暗号鍵と秘密鍵のペアを作ります
kagyuu@grape:~> cd .ssh/ kagyuu@grape:~/.ssh> ls id_rsa id_rsa.pub kagyuu@grape:~/.ssh> cat id_rsa.pub >> authorized_keys
kagyuu@grape:~> chmod 755 .ssh kagyuu@grape:~> chmod 755 .ssh/authorized_keys
# diff -u sshd_config.original sshd_config --- sshd_config.original 2006-08-12 18:00:30.000000000 +0900 +++ sshd_config 2006-08-12 22:59:56.000000000 +0900 @@ -114,3 +114,10 @@ AcceptEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES AcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT AcceptEnv LC_IDENTIFICATION LC_ALL +IgnoreRhosts yes +IgnoreUserKnownHosts no +PrintMotd yes +StrictModes yes +RSAAuthentication yes +PermitRootLogin no +PermitEmptyPasswords no
[~]$ cat ~/.ssh/config Host grape HostName 192.168.1.6 User kagyuu
[~]$ ssh -Y grape Password: Warning: No xauth data; using fake authentication data for X11 forwarding. Last login: Sun Apr 18 21:38:10 2010 from 192.168.1.131 Have a lot of fun... kagyuu@grape:~> xterm &
[~]$ ssh grape -L10000:192.168.1.6:80 Password: Last login: Sun Apr 18 21:38:58 2010 from 192.168.1.131 Have a lot of fun... kagyuu@grape:~>