3

I'm trying to set up Agent Forwarding on my MacBook Air running Mountain Lion.

Locally, I can run ssh -T [email protected] and I successfully connect to github.

When I try to ssh to my server and run ssh -T [email protected], it says permission denied.

Here's ~/.ssh/config

Host <my host>
  ForwardAgent yes

Output of ssh -v <my server>

debug1: Reading configuration data /Users/tombleymaier/.ssh/config
debug1: /Users/tombleymaier/.ssh/config line 1: Applying options for <host>
debug1: Reading configuration data /etc/ssh_config
debug1: /etc/ssh_config line 20: Applying options for *
debug1: Connecting to <host> [<ip>] port 22.
debug1: Connection established.

/etc/ssh_config (line 20+)

 Host *
   SendEnv LANG LC_*
#   ForwardAgent no
#   ForwardX11 no
#   RhostsRSAAuthentication no
#   RSAAuthentication yes
#   PasswordAuthentication yes
#   HostbasedAuthentication no
#   GSSAPIAuthentication no
#   GSSAPIDelegateCredentials no
#   GSSAPIKeyExchange no
#   GSSAPITrustDNS no
#   BatchMode no
#   CheckHostIP yes
#   AddressFamily any
#   ConnectTimeout 0
#   StrictHostKeyChecking ask
#   IdentityFile ~/.ssh/identity
#   IdentityFile ~/.ssh/id_rsa
#   IdentityFile ~/.ssh/id_dsa
#   Port 22
#   Protocol 2,1
#   Cipher 3des
#   Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc
#   MACs hmac-md5,hmac-sha1,[email protected],hmac-ripemd160
#   EscapeChar ~
#   Tunnel no
#   TunnelDevice any:any
#   PermitLocalCommand no
#   VisualHostKey no
#   ProxyCommand ssh -q -W %h:%p gateway.example.com

I set this up on another MacBook running Mountain Lion without issue.

3
  • Once of your server, do you have the same keys (~/.ssh/id_rsa, ~/.ssh/id_rsa.pub) than you had locally? If you don't have those key when ssh'ing to your server, you won't be able to complete the ssh to github. Commented Aug 25, 2012 at 8:47
  • 1
    @VonC - I thought the point of the forward agent was that the keys didn't have to be installed on the intermediate machine? Commented Aug 27, 2012 at 17:14
  • Right, I just re-read codegnome.com/blog/2012/08/26/… . What does a return ssh -Tvvv [email protected] executed on your server? Commented Aug 27, 2012 at 18:27

1 Answer 1

5

Turns out the identity was being removed from the local ssh-agent of every reboot. Gotta run the ssh-add with a -k command: ssh-add -K ~/.ssh/privateKey.txt

From: SVN+SSH, not having to do ssh-add every time? (Mac OS)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.