I have a mac at home and a mac at work. The work mac is setup for ssh to all work related servers. Sometimes I have to connect from my home mac and access the servers which are setup on my work mac. When I connect to VPN and ssh into my work mac, and try to ssh to any other servers which are set in the config of my work mac it's asking for my passphrase for the user of my work mac, which I don't have any, so I just hit enter and then it asks for the password for the server I want to connect to (keyless ssh setup).

The ssh-agent is not running by default when I connect to my work mac via ssh. I have to start it manually.

I also have a similar setup on my home mac, sshing into a linux virtualbox and then to an amazon ec2 instance using the ssh-agent from the box and it works fine without any problems.

Could you tell me how to fix this issue? Or a workaround?

  • 1
    I am not sure what you are asking. Are you wondering why your ssh daemon is not running automatically when you boot your Mac?
    – SunSparc
    Jul 19, 2013 at 18:38
  • When I sshd into my work mac from my home mac I tried to add the key to the agent with ssh-add, and it gave me "Could not open a connection to your authentication agent.". So I need to start the agent manually with ssh-agent command.
    – Matyas
    Jul 20, 2013 at 11:48

1 Answer 1


If you'd like to have keys added to an ssh-agent when you SSH in, you're still going to have to enter the passphrase, but you could set up your .bashrc to run these commands automatically for you.

If, however, you're looking to have the keys you've already unlocked on your home system also used for further ssh sessions from work, you can use the ForwardAgent option in your ssh_config file (~/.ssh/config).

  • I do not have a passphrase for the key, that's why I just hit enter, to leave it empty, and then it asks for the password for the user I try to connect to remote server with. I don't know that password as we are using passwordless ssh. Also I would like to use the work config from home an not the other way around, so if I use forward agent from home I would use my home key on the work mac and the work servers do not have my home key added to authorized keys.
    – Matyas
    Jul 20, 2013 at 11:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .