Skip to content

Instantly share code, notes, and snippets.

@adojos
Last active April 17, 2023 21:10
Show Gist options
  • Save adojos/d0096d5a5fdb9b0e602243108a6b3f0b to your computer and use it in GitHub Desktop.
Save adojos/d0096d5a5fdb9b0e602243108a6b3f0b to your computer and use it in GitHub Desktop.
SSH: Common SSH Commands #ssh

OpenSSH Commands Reference


Commands Description
ssh -V Prints SSH-Agent verion information
ls -al ~/.ssh List existing SSH Keys from standard SSH folder in user profile folder
ssh-keygen -t rsa -b 4096 -C "your_email@example.com" Generating SSH Keys using SSH-Keygen tool of OpenSSH
eval $(ssh-agent -s) Starts the SSH-Agent in the background
ssh-add ~/.ssh/id_rsa Adds your Private key to SSH-Agent
ssh -T git@github.com Testing your GitBash authentication with Github
ssh-keygen -p Changing passphrase of an existing SSH Key
ssh-add -D For removing 'ALL' private keys from the SSH-Agent
ssh-add -d /home/user/.ssh/id_rsa For removing 'A Single' named private key from the SSH-Agent
eval $(ssh-agent -s) Starts the SSH-Agent
ssh-add -l To list the ssh-keys currently available with SSH-Agent
ssh-add -L With the -L option, the keys in the SSH-Agent can be listed as well. While the -l option shows the fingerprint for each key, the -L option shows the public key part of each key.
eval $(ssh-agent -s -k) To terminate the SSH-Agent the following command can be executed. kill the SSH-Agent.

Reference Links

Official OpenSSH Commands Reference


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment