how do we specify an ssh default identity?

In your ~/.ssh/config file put:

IdentityFile /home/myuser/.ssh/keyhello

which will tell the outgoing ssh connections to use that as the default identity


You can specify an alternate keyfile on the command line with the -i option, or you can change it permanently with IdentityFile in the ssh client config file.


/usr/bin/ssh-copy-id will use the last created file that match id_*.pub. To change which one is default just touch it.

me@my-machine:~/.ssh$ touch id_rsa id_rsa.pub

Tags:

Ssh