At work, I can ssh to a server with private keys set up on my work machine.
jake@work$ ssh server
jake@server$
I’m trying to ssh from home to work to server with the private keys. The process should look like this:
jake@home$ ssh work
jake@work$ ssh server
jake@server$
But instead its asking me for a password. If I call ssh server with -v, it shows that its looking for keys .ssh/id_dsa and .ssh/id_rsa but my key is named differently.
I can get into server by specifying the key myself:
jake@home$ ssh work
jake@work$ ssh server -i .ssh/idfoo
jake@server$
How do I get ssh to find the right keys for this two step login process?
You can specify the key using Host+IdentityFile in your ~/.ssh/config on
work:Or just this alone in the config file, to apply a key identity to all sessions:
But I can’t explain why this is required only when trying to ssh from
work->serverfrom aworkssh session.