Skip to content

Latest commit

 

History

History
77 lines (53 loc) · 1.45 KB

github-git-ssh.md

File metadata and controls

77 lines (53 loc) · 1.45 KB

github git ssh

setup

  • generate key
cd ~/.ssh
ssh-keygen -t rsa -f github.id_rsa
  • edit ~/.ssh/config ( replace devel0 with your username )
Host github.com
	User devel0
	IdentityFile ~/.ssh/github.id_rsa
cat ~/.ssh/github.id_rsa.pub
  • test access
devel0@tuf:~/.ssh$ ssh -T git@github.com 
Hi devel0! You've successfully authenticated, but GitHub does not provide shell access.
  • test DENY

⚠️ ssh-add -D will remove cached ssh agent keys

mv ~/.ssh/github.id_rsa ~/.ssh/github.id_rsa.disabled
ssh-add -D

now a login ty

devel0@tuf:~/.ssh$ ssh -T git@github.com  
sign_and_send_pubkey: signing failed for RSA "/home/devel0/.ssh/github.id_rsa" from agent: agent refused operation
git@github.com: Permission denied (publickey).

then restore valid key

mv ~/.ssh/github.id_rsa.disabled ~/.ssh/github.id_rsa

convert https to git ssh access

to view current remote

git remote -v

if you have a working copy clone though https and want to switch to ssh can do with

git remote set-url origin git@github.com:USERNAME/REPO.git

the url can be retrieved from CLONE btn of your repo selecting ssh, example

git remote set-url git@github.com:devel0/iot-examples.git

References: