SSH Changes in May 2019

From SciNet Users Documentation
Jump to navigation Jump to search

SSH Changes in May 2019 (English)

(La version francaise suit.)

What Changed?

During the 29-30 May 2019 shutdown, we made the following ssh security improvements on Niagara:

  1. Disabled certain weak encryption algorithms.
  2. Disabled certain weak public key types.
  3. Regenerated Niagara's host keys.

Updating your client's known host list

The first time you login to Niagara after the shutdown, you will probably see the following warning message:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the ED25519 key sent by the remote host is
SHA256:SauX2nL+Yso9KBo2Ca6GH/V9cSFLFXwxOECGWXZ5pxc.
Please contact your system administrator.
Add correct host key in /home/username/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /home/username/.ssh/known_hosts:109
ED25519 host key for niagara.scinet.utoronto.ca has changed and you have requested strict checking.
Host key verification failed.
Killed by signal 1.

This warning is displayed because the host keys on Niagara changed to increase the data centres security, and ssh clients remember old host keys to prevent "man-in-the-middle" attacks.

You may also get a warning regarding "DNS spoofing", which is related to the same change.

If you are using MobaXTerm, Putty, or WinSCP as your ssh (or scp) client under Windows, the warning will appear in a pop-up window and will allow you to accept the new host key by clicking "Yes".

If you are using the command line ssh command on macOS, Linux, GitBash or Cygwin, you should tell your system to "forget" the old host keys, by running the following commands:

$ ssh-keygen -R niagara.scinet.utoronto.ca
$ ssh-keygen -R niagara.computecanada.ca
$ ssh-keygen -R 142.150.188.70
$ ssh-keygen -R nia-datamover1.scinet.utoronto.ca
$ ssh-keygen -R nia-datamover2.scinet.utoronto.ca
$ ssh-keygen -R 142.150.188.131
$ ssh-keygen -R 142.150.188.132

Afterwards, the next time you ssh to Niagara you'll be asked to confirm the new host keys, e.g.:

$ ssh niagara.scinet.utoronto.ca
The authenticity of host 'niagara.scinet.utoronto.ca (142.150.188.70)' can't be established.
ED25519 key fingerprint is SHA256:SauX2nL+Yso9KBo2Ca6GH/V9cSFLFXwxOECGWXZ5pxc.
ED25519 key fingerprint is MD5:b4:ae:76:a5:2b:37:8d:57:06:0e:9a:de:62:00:26:be.
Are you sure you want to continue connecting (yes/no)? 

Make sure the fingerprints are correct! You'll either see the above ED25519 fingerprints, or the following RSA fingerprints:

RSA key fingerprint is SHA256:k6YEhYsI73M+NJIpZ8yF+wqWeuXS9avNs2s5QS/0VhU.
RSA key fingerprint is MD5:98:e7:7a:07:89:ef:3f:d8:68:3d:47:9c:6e:a6:71:5e.

If the fingerprints don't match, someone may be trying to hijack your connection.

Troubleshooting

I can't connect!

If you see one of the following error messages:

Unable to negotiate with 142.150.188.70 port 22: no matching cipher found.
Unable to negotiate with 142.150.188.70 port 22: no matching key exchange method found.
Unable to negotiate with 142.150.188.70 port 22: no matching mac found.

you need to upgrade your ssh client.

My SSH key no longer works

If you're being asked for a password, but were using SSH keys, it's because 1024-bit DSA & RSA keys have been disabled.

You need to generate a new stronger key, see the SSH keys page for details.

(What follows it the French version of the above information).

Les changement de SSH à mai 2019 (version française)

Qu'est-ce qui a changé?

Pendant l'arrêt planifié des 29 et 30 mai 2019, nous avons mis en place les mesures suivantes à Niagara pour améliorer sa securité:

  1. Certaines méthodes de chiffrement faibles ont été désactivées.
  2. Certains types de clé publique SSH ont été désactivés.
  3. Les clés d'hôte de Niagara ont été régénérées.

Mettre à jour la liste de clés d'hôte de votre client SSH

Lorsque vous vous reconnectez à Niagara pour la première fois apres l'arrêt de maintenance, vous verrez probablement le message suivante:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the ED25519 key sent by the remote host is
SHA256:SauX2nL+Yso9KBo2Ca6GH/V9cSFLFXwxOECGWXZ5pxc.
Please contact your system administrator.
Add correct host key in /home/username/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /home/username/.ssh/known_hosts:109
ED25519 host key for niagara.scinet.utoronto.ca has changed and you have requested strict checking.
Host key verification failed.
Killed by signal 1.

Ce message d'avertissement s'affiche parce que les clés d'hôte de Niagara ont été régénérées pour améliorer le securité de le centre de données, mais le client SSH a stocké les clés d'hôte anciennes pour empêcher une « attaque de l'homme du milieu ».

C'est possible que vous verrez aussi un message d'avertissement sur « DNS spoofing ».

Si vous utilisez un des outils de connexion MobaXTerm, PuTTY et WinSCP sous Windows, le message d'avertissment s'affiche dans une fenêtre contextuelle qui offre l'option d'accepter la nouvelle clé de hôte par appuyer sur le bouton approprié.

Si vous utilisez le command « ssh » dans une fenêtre de terminal sur macOS, Linux, GitBash ou Cygwin, vous devez dire à votre système d'oublier les anciennes clés de l'hôte avec les commandes suivantes:

$ ssh-keygen -R niagara.scinet.utoronto.ca
$ ssh-keygen -R niagara.computecanada.ca
$ ssh-keygen -R 142.150.188.70

Ensuite, lors de votre prochaine visite à Niagara, vous devrez confirmer les nouvelles clés d’hôte, par exemple:

$ ssh niagara.scinet.utoronto.ca
The authenticity of host 'niagara.scinet.utoronto.ca (142.150.188.70)' can't be established.
ED25519 key fingerprint is SHA256:SauX2nL+Yso9KBo2Ca6GH/V9cSFLFXwxOECGWXZ5pxc.
ED25519 key fingerprint is MD5:b4:ae:76:a5:2b:37:8d:57:06:0e:9a:de:62:00:26:be.
Are you sure you want to continue connecting (yes/no)? 

Assurez-vous que les empreintes digitales (« fingerprints ») sont correctes! Vous verrez soit les empreintes ED25519 ci-dessus, soit les empreintes RSA suivantes:

RSA key fingerprint is SHA256:k6YEhYsI73M+NJIpZ8yF+wqWeuXS9avNs2s5QS/0VhU.
RSA key fingerprint is MD5:98:e7:7a:07:89:ef:3f:d8:68:3d:47:9c:6e:a6:71:5e.

Si les empreintes digitales ne correspondent pas, il est possible que quelqu'un tente de détourner votre connexion.

Dépannage

Je n'arrive pas à me connecter!

Si vous voyez l'un des messages d'erreur suivants:

Unable to negotiate with 142.150.188.70 port 22: no matching cipher found.
Unable to negotiate with 142.150.188.70 port 22: no matching key exchange method found.
Unable to negotiate with 142.150.188.70 port 22: no matching mac found.

vous devez mettre à jour le client ssh.

Ma clé SSH ne fonctionne plus

Si un mot de passe vous est demandé alors que vous utilisiez auparavant des clés SSH, c'est probablement parce que les clés DSA et RSA 1024 bits ont été désactivées.

Vous devez générer une nouvelle clé plus puissante, voir la page SSH keys pour plus de détails.