Instructions to create, manage and use SSH keys.
- Run the following command, replacing the
FILENAMEtext with the filename which to save the key:
ssh-keygen -t rsa -f FILENAME- Enter a new passphrase (leave it blank if you don't want to add a pass)
- Enter the same passphrase again
- Expected output:
Your identification has been saved in FILENAME
Your public key has been saved in FILENAME.pub
The key fingerprint is:
SHA256:y6dC03iTVrns/A2B6KxDPRrnQRQq/ju3YeOpg2SsGYo anpix@Alienpix
The key's randomart image is:
+---[RSA 3072]----+
| .. |
| .. |
| . .. . |
| . . ..o. |
| .. =S+... |
| . +.*+@.o . |
|.. * +.OO*. . |
|E o . *=o*o o |
| +B=. .. . |
+----[SHA256]-----+- Open the pub key
FILENAME.pubfile and copy the entire content - Follow the instructions below related to the service that you want to use.
- Go to the Github SSH Keys page.
- Click on
New SSH keyto open the form. - Insert a title to identify your key
- Paste the pub key content into the
Keytextarea. - Click in
Add SSH keyto save
- Click on the
~User Settingsbutton located at the upper right corner, just before your user photo. - Click on the
SSH public keysto open the SSH page. - Alternativelly you can change the
PROJECT_NAMEplaceholder and use the following url:https://dev.azure.com/PROJECT_NAME/_usersSettings/keys. - Click on
New keyto open the form. - Insert a name to identify your key
- Paste the pub key content into the
Public Key Datatextarea. - Click on
Addto save.
- Check if the SSH agent is running
get-service ssh-agentExpected result:
Status Name DisplayName
------ ---- -----------
Running ssh-agent OpenSSH Authentication Agent- If the status is not
Running, set the startup as automatic and start the service
set-service ssh-agent -StartupType Automatic
start-service ssh-agentset-service ssh-agent -StartupType Manual
stop-service ssh-agent- Run
ssh-addto register the key in your machine
ssh-add ~/.ssh/FILENAME- Check if the key was registered
ssh-add -l- Add each host as known
ssh -T git@github.com
ssh -T git@ssh.dev.azure.com| Service | Value |
|---|---|
| Azure Devops | git@ssh.dev.azure.com |
| GitHub | git@github.com |
Expected output for GitHub
PS C:\Users\Anpix\.ssh> ssh -T git@github.com
The authenticity of host 'github.com (4.228.31.150)' can't be established.
ED25519 key fingerprint is SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'github.com' (ED25519) to the list of known hosts.
Hi Anpix! You've successfully authenticated, but GitHub does not provide shell access.Expected output for Azure DevOps
PS C:\Users\Anpix\.ssh> ssh -T git@ssh.dev.azure.com
The authenticity of host 'ssh.dev.azure.com (191.235.226.36)' can't be established.
RSA key fingerprint is SHA256:ohD8VZEXGWo6Ez8GSEJQ9WpafgLFsOfLOtGGQCQo6Og.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'ssh.dev.azure.com' (RSA) to the list of known hosts.
remote: Shell access is not supported.
shell request failed on channel 0