Skip to content

Instantly share code, notes, and snippets.

@Beyarz
Last active May 1, 2024 11:42
Show Gist options
  • Save Beyarz/3956fde864b5f254f24a16c3b547f0eb to your computer and use it in GitHub Desktop.
Save Beyarz/3956fde864b5f254f24a16c3b547f0eb to your computer and use it in GitHub Desktop.
Ssh key

SSH

Create key

ssh-keygen -t rsa -b 4096 -C "[email protected]"

Get public key

cat /Users/NAME/.ssh/id_rsa.pub

Get private key

cat /Users/NAME/.ssh/id_rsa

Required to enter passphrase after every git pull?

ssh-add ~/.ssh/id_rsa

ssh-copy-id

Sign in without having to enter your password in the future
ssh-copy-id user@host

Add public-key to keyring

ssh-add -K

Test password

ssh-keygen -y

Add key in Windows

ssh-add C:\Users\name\.ssh\id_rsa

If it fails then the ssh-agent service is probably disabled or not running.

Run the following in powershell (as admin mode): Get-Service ssh-agent and look for the status.

If it is disabled then run the following: Get-Service -Name ssh-agent | Set-Service -StartupType Manual

After that run the ssh-add command again.

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