User Tools

Site Tools


mywiki:linux:ssh

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
mywiki:linux:ssh [2016/06/03 16:27] – created shaoguohmywiki:linux:ssh [2019/09/15 18:55] (current) – external edit 127.0.0.1
Line 1: Line 1:
 +SSH Login Without Password Using ssh-keygen & ssh-copy-id
  
 +Suppose need to use ssh to login to remote PC B from local PC A
 +
 +  * Create public and private keys using ssh-key-gen at At PC A
 +**Take note: make sure use empty passphrase for auto login without password case**
 +<file>
 +  ssh-keygen
 +  Generating public/private rsa key pair.
 +  Enter file in which to save the key (/home/xxxx/.ssh/id_rsa):[Enter key]
 +  Enter passphrase (empty for no passphrase): [Press enter key only]
 +  Enter same passphrase again: [Press enter key again]
 +  Your identification has been saved in /home/xxxx/.ssh/id_rsa.
 +  Your public key has been saved in /home/xxxx/.ssh/id_rsa.pub.
 +  The key fingerprint is:
 +  94:12:45:fd:24:12:98:76:98:23:97:56:12:64:86:36 xxxx@local-host
 +</file>
 +
 +  * Copy the public key from PC A to remote PC B using ssh-copy-id
 +<file>
 +  ssh-copy-id -i ~/.ssh/id_rsa.pub remote-PC-B
 +  xxxx@remote-PC-B's password: [key in the real key for the first time]
 +</file>
 +
 +  * Login to remote PC B without password
 +<file>
 +  ssh remote-PC-B
 +</file>      
mywiki/linux/ssh.1464942475.txt.gz · Last modified: (external edit)