forked from gotbletu/shownotes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathssh_passwordlesskey.txt
37 lines (25 loc) · 1.24 KB
/
ssh_passwordlesskey.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
Notes for video: http://www.youtube.com/watch?v=LlGL-uBSe6M
## ssh passwordless login
username:
local pc = heoyea
server pc = heoyea-core
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.
Enter file in which to save the key (/home/heoyea/.ssh/id_rsa):[Press Enter key]
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)
# this will send pub key and create ~/.ssh/authorized_keys file on server pc
# Note: ssh-copy-id command will append keys, not overwrite it ( good for multiple keys)
ssh-copy-id -i ~/.ssh/id_rsa.pub [email protected]
B2. copy local pub key to server pc (method 2) - use if ssh-copy-id command on not on your system
# send keys to server
scp ~/.ssh/id_rsa.pub [email protected]:/tmp/
# login to server pc then append keys manually
cat /tmp/id_rsa.pub >> ~/.ssh/authorized_keys
# remove public key file from tmp folder
rm /tmp/id_rsa.pub