2014-01-26 22:11:01 +00:00
|
|
|
Notes for video: http://www.youtube.com/watch?v=LlGL-uBSe6M
|
|
|
|
|
|
|
|
|
|
|
|
## ssh passwordless login
|
|
|
|
|
2014-01-26 22:34:29 +00:00
|
|
|
username:
|
|
|
|
local pc = heoyea
|
|
|
|
server pc = heoyea-core
|
|
|
|
|
|
|
|
|
2014-01-26 22:11:01 +00:00
|
|
|
A. generate a public key ( this will create id_rsa / id_rsa.pub files in ~/.ssh folder )
|
|
|
|
ssh-keygen
|
|
|
|
|
|
|
|
# ex: prompt to comeplete
|
|
|
|
Generating public/private rsa key pair.
|
2014-01-26 22:34:29 +00:00
|
|
|
Enter file in which to save the key (/home/heoyea/.ssh/id_rsa):[Press Enter key]
|
2014-01-26 22:11:01 +00:00
|
|
|
Enter passphrase (empty for no passphrase): [Press Enter key]
|
|
|
|
Enter same passphrase again: [Pess Enter key]
|
|
|
|
Your identification has been saved in /home/heoyea/.ssh/id_rsa.
|
|
|
|
Your public key has been saved in /home/heoyea/.ssh/id_rsa.pub.
|
|
|
|
|
|
|
|
B1. copy local pub key to server pc (method 1)
|
2014-01-26 22:23:50 +00:00
|
|
|
# this will send pub key and create ~/.ssh/authorized_keys file on server pc
|
2014-01-26 22:11:01 +00:00
|
|
|
# Note: ssh-copy-id command will append keys, not overwrite it ( good for multiple keys)
|
2014-01-26 22:23:50 +00:00
|
|
|
|
2014-01-26 22:11:01 +00:00
|
|
|
ssh-copy-id -i ~/.ssh/id_rsa.pub heoyea-core@192.168.1.100
|
|
|
|
|
2014-01-26 22:29:58 +00:00
|
|
|
B2. copy local pub key to server pc (method 2) - use if ssh-copy-id command on not on your system
|
2014-01-26 22:11:01 +00:00
|
|
|
# send keys to server
|
|
|
|
scp ~/.ssh/id_rsa.pub heoyea-core@192.168.1.100:/tmp/
|
2014-01-26 22:23:50 +00:00
|
|
|
|
2014-01-26 22:11:01 +00:00
|
|
|
# login to server pc then append keys manually
|
|
|
|
cat /tmp/id_rsa.pub >> ~/.ssh/authorized_keys
|
2014-01-26 22:23:50 +00:00
|
|
|
|
|
|
|
# remove public key file from tmp folder
|
|
|
|
rm /tmp/id_rsa.pub
|
2014-01-26 22:11:01 +00:00
|
|
|
|