3 ms·
Is it a good practice to use only one SSH key pair or different pairs for different things? Also, how do people usually store SSH keys for long term?
by yewenjie 5y ago
Is it a good practice to use only one SSH key pair or different pairs for different things? Also, how do people usually store SSH keys for long term?
- elric 5y agoI use a different key pair for every service. Where "service" is defined pretty loosely. All the company servers I access for work, for instance, use the same key pair. But I have different key pairs for github, gitlab, etc. I also have a work github account for FOSS contributions, which uses a different key pair than my personal github account. I have a config file per identity (work, personal, second job, etc) in ~/.git/config_$identity. Each of those files contains a Host entry with key configuration for every service I use. I rely on a bit of shell foo to to select the correct identity (an environment variable and an alias). Life would be a bit easier if ssh_config supported the use of variables in Include statements, that way I could just Include ~/config_${identity}. Oh well.