Skip to content

SSH#

Generate SSH key#

ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
# -C is comment (optional) can be your email, helps identify the key.
# -f specifies the file to save the key (default: ~/.ssh/id_rsa). if need custom like personal.pu have to use -f ~/.ssh/personal_id_rsa

Creates:

~/.ssh/id_rsa
~/.ssh/id_rsa.pub

Connect to server#

ssh user@your.server.com

Connect with custom key#

ssh -i /path/to/id_rsa user@your.server.com

View public key#

cat ~/.ssh/id_rsa.pub

View private key#

cat ~/.ssh/id_rsa