krulik
6/12/2017 - 8:47 AM

Generate SSH keys

Generate SSH keys

# generate the key
ssh-keygen -t rsa

# Generating public/private rsa key pair.
# Enter file in which to save the key (/demo/.ssh/id_rsa): 
# Enter passphrase (empty for no passphrase): 
# Enter same passphrase again: 
# Your identification has been saved in /demo/.ssh/id_rsa.
# Your public key has been saved in /demo/.ssh/id_rsa.pub.
# The key fingerprint is:
# 4a:dd:0a:c6:35:4e:3f:ed:27:38:8c:74:44:4d:93:67 demo@a
# The key's randomart image is:
# +--[ RSA 2048]----+
# |          .oo.   |
# |         .  o.E  |
# |        + .  o   |
# |     . = = .     |
# |      = S = .    |
# |     o + = +     |
# |      . o + o .  |
# |           . o   |
# |                 |
# +-----------------+

# show the key
cat ~/.ssh/id_rsa.pub

# connect
ssh root@[your.ip.address.here]

# more info: https://www.digitalocean.com/community/tutorials/how-to-use-ssh-keys-with-digitalocean-droplets