Difference between revisions of "Ssh"

From Wikili
Jump to: navigation, search
(SSH login without password=)
(SSH login without password)
Line 1: Line 1:
 
=== SSH login without password ===
 
=== SSH login without password ===
 +
It's common to use ssh and scp for communicating and transferring files to and from a server. If you want to auto-login without a password, here's how to setup SSH to use encryption keys to do so.
 +
 +
* Run '''ssh-keygen''' to create an encryption key pair, the public and private keys on your PC. You can just hit return for each question.
 +
  maurice:~>  ssh-keygen -t dsa
 +
  [backup@server ~]$ ssh-keygen -t rsa
 +
Generating public/private dsa key pair.
 +
Enter file in which to save the key (/home/kchennen/.ssh/id_dsa):
 +
Created directory '/home/kchennen/.ssh'.
 +
Enter passphrase (empty for no passphrase):
 +
Enter same passphrase again:
 +
Your identification has been saved in /home/kchennen/.ssh/id_dsa.
 +
Your public key has been saved in /home/kchennen/.ssh/id_dsa.pub.
 +
The key fingerprint is:
 +
93:42:01:20:1a:de:a5:ad:7c:eb:fe:7f:52:e8:a2:a7 kchennen@maurice
 +
The key's randomart image is:
 +
+--[ DSA 1024]----+
 +
|o ...o.          |
 +
|oo. +  .        |
 +
|.. o ..          |
 +
|  . ..  .      |
 +
|  o .. S .      |
 +
|    . .. o .    |
 +
|    .  . .      |
 +
|    .  o o .    |
 +
|    .E=.o.o      |
 +
+-----------------+
 +
 +
 +
 +
Generating public/private rsa key pair.
 +
Enter file in which to save the key (/home/backup/.ssh/id_rsa):
 +
Created directory '/home/backup/.ssh'.
 +
Enter passphrase (empty for no passphrase):
 +
Enter same passphrase again:
 +
Your identification has been saved in /home/backup/.ssh/id_rsa.
 +
Your public key has been saved in /home/backup/.ssh/id_rsa.pub.

Revision as of 11:29, 18 October 2013

SSH login without password

It's common to use ssh and scp for communicating and transferring files to and from a server. If you want to auto-login without a password, here's how to setup SSH to use encryption keys to do so.

  • Run ssh-keygen to create an encryption key pair, the public and private keys on your PC. You can just hit return for each question.
 maurice:~>  ssh-keygen -t dsa
 [backup@server ~]$ ssh-keygen -t rsa

Generating public/private dsa key pair. Enter file in which to save the key (/home/kchennen/.ssh/id_dsa): Created directory '/home/kchennen/.ssh'. Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/kchennen/.ssh/id_dsa. Your public key has been saved in /home/kchennen/.ssh/id_dsa.pub. The key fingerprint is: 93:42:01:20:1a:de:a5:ad:7c:eb:fe:7f:52:e8:a2:a7 kchennen@maurice The key's randomart image is: +--[ DSA 1024]----+ |o ...o. | |oo. + . | |.. o .. | | . .. . | | o .. S . | | . .. o . | | . . . | | . o o . | | .E=.o.o | +-----------------+


Generating public/private rsa key pair. Enter file in which to save the key (/home/backup/.ssh/id_rsa): Created directory '/home/backup/.ssh'. Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/backup/.ssh/id_rsa. Your public key has been saved in /home/backup/.ssh/id_rsa.pub.