Setup SSH on macOS

Check if you already have an available SSH key

ls $HOME/.ssh

If the files id_ed25519 and id_ed25519.pub are in the ~/.ssh folder, you don’t need to follow this guide, you already have your SSH key.

Create a new SSH key pair

ssh-keygen -t ed25519

Follow the instructions to generate a new SSH key pair. You will be asked to encrypt your private key with a password. This step is optional but for further security you may want to set one.

By default, both private and public keys will be located in your $HOME/.ssh directory.

Add the public SSH key to Scalingo

To get the content of the public SSH key, you need to run the following command:

$ cat ~/.ssh/id_ed25519.pub

The file content should start with ssh-ed25519

Once you have the public key, go to Scalingo Dashboard SSH key section and create a new key with the content of the public key.

Managing Multiple SSH Keys

For users with multiple SSH keys, ensure SSH selects the correct key for Scalingo connections by editing your ~/.ssh/config file (depending on the region you need to access):

Host ssh.osc-fr1.scalingo.com
  IdentityFile ~/.ssh/custom_scalingo_key
  IdentitiesOnly yes

or

Host ssh.osc-secnum-fr1.scalingo.com
  IdentityFile ~/.ssh/custom_scalingo_key
  IdentitiesOnly yes

Replace ~/.ssh/custom_scalingo_key with the path to your Scalingo SSH key. No need to reload the SSH configuration, changes are instantaneous.

Check everything is working

In a terminal, run the following command (depending on the region:

$ ssh -T git@ssh.osc-fr1.scalingo.com

or

$ ssh -T git@ssh.osc-secnum-fr1.scalingo.com

It should display the following output:

You've successfully authenticated on Scalingo, but there is no shell access

If it doesn’t, something has been done wrong. Please recheck the different step of this guide.


Suggest edits

Setup SSH on macOS

©2024 Scalingo