Saturday, October 6, 2018

SSH Keys setup on Linux & export to host

1. Generate keys

ssh-keygen -t rsa
 

2. Choose a passhprase and where to save them

admin@srv2:~ $ ssh-keygen -t rsa
 

Generating public/private rsa key pair.
Enter file in which to save the key (/home/administrator/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/administrator/.ssh/id_rsa.
Your public key has been saved in /home/administrator/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:r3UBzHijPvB9W1uHnijOO7tQeoGrkijSNpw0QR1+8 admin@srv2
The key's randomart image is:
+---[RSA 2048]----+
|  o...        . .|
|   o  .  +   . + |
|  .    .. * . B .|
| .      .+ + * +o|
|  .   ..S . + +.o|
| o . o +E*   + +.|
|  + * o + * o * .|
| . o o . + o + . |
|    .   .   .    |
+----[SHA256]-----+
admin@srv2:~ $

3. Export keys to other host

 ssh-copy-id -p 22 uzivatel@1.2.3.4

debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/administrator/.ssh/id_rsa
debug3: send_pubkey_test
debug3: send packet: type 50
debug2: we sent a publickey packet, wait for repl

No comments:

Post a Comment

Thank you for your comment. Will try to react as soon as possible.

Regards,

Networ King