You are not logged in.
Hi!
I have placed the second ssh keys pair as ~/.ssh/identity[.pub]. Also, I use enabled/running gpg-agent service (with --user flag) with SSH support. After logging in to be able to use the second pair I must invoke ssh-add <path to key> and restart gpg-agent.
So, the question is: how to configure all this mechanics to avoid manual manipulations?
"I exist" is the best myth I know..
Offline
man ssh_config
There are a couple of examples in the wiki too.
Last edited by TheChickenMan (2016-06-11 12:14:42)
If quantum mechanics hasn't profoundly shocked you, you haven't understood it yet.
Niels Bohr
Offline
man ssh_config
There are a couple of examples in the wiki too.
I have tried ~/.ssh/config containing
Host *
IdentityFile ~/.ssh/id_rsa ~/.ssh/second
without success. As well as
Host *
IdentityFile ~/.ssh/id_rsa
IdentityFile ~/.ssh/second
Last edited by student975 (2016-06-11 12:51:33)
"I exist" is the best myth I know..
Offline
It parses from the top of the file, taking whatever the first match for "Host" is. Since you have Host * that will match everything. You need a more specific Host for the first entry and then either a second specific one or a general one. Ex:
Host 10.0.0.1
IdentityFile ~/.ssh/ssh_auth_1
Host 10.0.0.*
IdentityFile ~/.ssh/ssh_auth_2
Host *
IdentityFile ~/.ssh/ssh_auth_general
If quantum mechanics hasn't profoundly shocked you, you haven't understood it yet.
Niels Bohr
Offline
Thanks!
At the moment I'm just forced to restart gpg-agent. It seems the last one starts (with --user) too early, and some "After" (or what) must be added to .service file.
"I exist" is the best myth I know..
Offline