-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathssh-without-password
More file actions
50 lines (40 loc) · 1.93 KB
/
ssh-without-password
File metadata and controls
50 lines (40 loc) · 1.93 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
First:
upb@samba:/home/staffoffice$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/home/upb/.ssh/id_rsa): *default enter
Enter passphrase (empty for no passphrase): *default enter
Enter same passphrase again: *default enter
Your identification has been saved in /home/upb/.ssh/id_rsa.
Your public key has been saved in /home/upb/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:32gwnRLAIjCp2HGXforXp3Q+NPP8lfCwH8TD/ZPP7Is upb@samba
The key's randomart image is:
+---[RSA 2048]----+
|oo ... |
|..o o +. |
|o. + + . |
|o . . .o . o .|
| . +S o o =.|
| . o o=*o * =|
| . . *+=.. *o|
| ..o o o++|
| . E.+*|
+----[SHA256]-----+
Second:
upb@samba:/home/staffoffice$ ssh-copy-id -i ~/.ssh/id_rsa.pub -p 6006 172.16.3.106
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/home/upb/.ssh/id_rsa.pub"
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
upb@172.16.3.106's password:
Number of key(s) added: 1
Now try logging into the machine, with: "ssh -p '6006' '172.16.3.106'"
and check to make sure that only the key(s) you wanted were added.
if Not Working Try this
samba@upb:~$ ssh-copy-id -i ~/.ssh/id_rsa.pub -p 6006 backupd@172.16.3.130
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/home/samba/.ssh/id_rsa.pub"
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
backupd@172.16.3.130's password:
Number of key(s) added: 1
Now try logging into the machine, with: "ssh -p '6006' 'backupd@172.16.3.130'"
and check to make sure that only the key(s) you wanted were added.