Carl-Christian Sautter | 03. December 2017 |   Ubuntu Debian Linux Administration

How To Generate an SSH Key-Pair

Generate SSH Keypair on Linux Shell/Bash

An SSH Key allows you to log into your server without needing a password. The tools to create and use SSH are standard, and should be present on most Linux distributions. With the following commands, you can generate an ssh key and transfer it to the target server.

# generate keypair
ssh-keygen -t rsa -b 4096

# copy key to target server
ssh-copy-id -i ~/.ssh/ user@remote-system

# test if key is working on target server
ssh -i /root/.ssh/id_rsa root@remote-system

Comments are disabled for this post.