Prev | Current Page 285 | Next

Chris Tyler

"X Power Tools"

On blue, create a public key, pressing ENTER to accept the default values for the
various prompts:
blue$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/chris/.ssh/id_rsa): ENTER
Enter passphrase (empty for no passphrase): ENTER
Enter same passphrase again: ENTER
Your identification has been saved in /home/chris/.ssh/id_rsa.
Your public key has been saved in /home/chris/.ssh/id_rsa.pub.
The key fingerprint is:
aa:bb:cc:dd:ee:ff:aa:bb:cc:dd:ee:ff:aa:bb:cc:dd chris@blue
2. Append the contents of the file ~/.ssh/id_rsa.pub on blue to ~/.ssh/authorized_
keys on red:
blue$ ssh chris@red "cat >>~/.ssh/authorized_keys" <~/.ssh/id_rsa.pub
chris@red's password:
13.14
13.14 Using Passphrase Protection of SSH Keys 191
3. Ensure that ~/.ssh/authorized_keys on red has 0600 permission:
blue$ ssh chris@red chmod 0600 ~/.ssh/authorized_keys
chris@red's password:
4. Confirm that you can log in to the remote system without a password using
SSH:
blue$ ssh red
red$
You can use the same public key with as many systems as you want; simply repeat
step 2 for each additional system.
The -v option to ssh is very useful when debugging connection problems.


Pages:
273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297