Fix forward agent issue

03 Jan 2017

Today I face an issue after I copied .ssh from Ubuntu machine to my Mac machine. I cannot do ssh and even after I can ssh, I cannot pull source code from the Git Repositories.

Fixed the issue follow these command, it’s NOT step by step tutorial, you have to check the permission and use some debug command to spot where the issue is.

SSH fix forward agent. https://developer.github.com/guides/using-ssh-agent-forwarding/

ssh-add yourkey_id_rsa  

And today, suddenly I found my key lost

 ssh-add -K [path/to/private SSH key]

http://unix.stackexchange.com/questions/140075/ssh-add-is-not-persistent-between-reboots

Debug:

ssh-add -l  
ssh -T git@github.com  
ssh-add -L  

CHMOD for your private key:

chmod 400 ~/.ssh/id_rsa

CHMOD for your public key:

chmod 644 ~/.ssh/id_rsa.pub

CHMOD for .ssh directory

chmod 700 ~/.ssh/id_rsa

Add new file config to ~/.ssh/config

Host *  
ForwardAgent yes  

Tweet me @huynhbathanh if you like this post.

Tweet
comments powered by Disqus