sh-notion/notion_data_team_no_files/Set up SSH keys 6b05d5e432164d30b6546bb8bb4ba524.md
Pablo Martin a256b48b01 pages
2025-07-11 16:15:17 +02:00

4.4 KiB
Raw Permalink Blame History

Set up SSH keys

As a member of the Data Team, youre going to need to use SSH keys for multiple reasons. Most importantly, you should have one personal key pair.

If you dont know what the hell SSH keys or you kind of know but you always have a headache, you have two options on how to deal with this:

Creating your key pair

  • You will need to have a Linux terminal available. If you still dont have WSL working on your laptop, get this done first: How to set up WSL and Docker Desktop
  • You should also have Keeper ready. But thats fine because its very first thing you did when you joined the company, right even before learning how the coffee machine works… right?
  • Open up an Ubuntu terminal
  • Run ssh-keygen -t rsa -b 4096 (note: DevOps only accepts RSA keys, not modern EC ones. Nasty, nasty microsoft)
    • You will get ask where do you want to store the key and how do you want to name it. Up to you. I advise you to store them in home/<your-user>/.ssh/. Feel free to use any name.
    • You will be asked to add a passphrase. This is highly recommended. Make sure you note the passphrase, theres absolutely no way to recover this.
  • This will have created two files
    • One with the name you provided (your private key)
    • Another with the same name, but an additional .pub at the end (the matching public key. These two match together. Thats why its a key pair).
    • Now make an entry in Keeper, private to you, to store these. You should store the passphrase in some text field, and the two key files (private and public) as attachments. Dont store them as text, high chances of mistakes doing that.
  • Finally, change the permissions on your private key by traveling with the terminal to ~/.ssh/ and running chmod 400 <the-name-of-your-private-key-file>.

Adding your keys to Azure Devops

There are two steps to set up SSH access to Azure Devops: placing your public key and configuring your ssh client to use your private key.

To place your public key:

  • Go to https://guardhog.visualstudio.com/.
  • Go to User Settings. Its the little icon of a person with a gear on the top right.
  • Click on SSH Public Keys
  • In the new page, add a new key.
    • You can give it any name.
    • The Public Key Data should hold the public key. To fill it in, run cat ~/.ssh/<your-public-key-that-ends-in-.pub>, copy the output and paste it here.
  • That should be it. You should now see the public key listed.

To configure your ssh client:

  • Create (or edit if it already exists) the file in ~/.ssh/config

  • Add a block like this:

    Host ssh.dev.azure.com
        Hostname ssh.dev.azure.com
        IdentityFile ~/.ssh/<your-private-key-file>
    
  • Thats it. Your SSH client will now know which key to use when interacting with Devops.

Finally, be aware you might experience some buggy behaviour with the URL paths provided by Devops when cloning Git repositories with SSH. Do not fall back to HTTP just because its giving you a headache. The problem is probably easily fixable, you can read more here: Little Git SSH cloning trick

Using SSH to access production VMs

Some of the machines in production are accessible through SSH.

If you need to log in there, depending on the circumstances, either we should add your public key to the right machine, or you should receive access to some of the service SSH keys that exist in the team.

If you need this, contact Pablo to discuss and he will sort things out for you.