Skip to main content

Managing Multiple SSH Keys

If you use different keys for different servers or services (e.g., GitHub, work, personal), here’s how to keep it organized. Using different keys for different services makes things way more organized and secure. This way if one key gets compromised, you only need to change it for that service or server.

Creating Multiple Keys

  1. Login to machine you want to have access to server or services
  2. Open Terminal and Create Keys
ssh-keygen -t rsa -b 4096 -f ~/.ssh/id_rsa_work
ssh-keygen -t rsa -b 4096 -f ~/.ssh/id_rsa_personal   'adding path will make the key unique and wont override the previous one'
  1. Send each key to it's designated server
ssh-copy-id ~/.ssh/id_rsa_work.pub username@server_ip