L'authentification SSH par clé publique perd l'authentification sur Windows Server
L'authentification SSH par clé publique perd l'authentification sur Windows Server
L'authentification SSH par clé publique fonctionne initialement sur mon Windows Server, mais après un certain temps, les connexions commencent à échouer et demandent un mot de passe.
Re: L'authentification SSH par clé publique perd l'authentification sur Windows Server
Ce problème est souvent causé par les permissions des fichiers authorized_keys sur Windows.
Vérifiez les points suivants :
1. Le fichier `authorized_keys` doit être dans `C:\Users\\.ssh\authorized_keys`
2. Pour le compte administrateur, il doit être dans `C:\ProgramData\ssh\administrators_authorized_keys`
3. Les permissions doivent être strictes — seul l'utilisateur et SYSTEM doivent avoir accès
4. Exécutez :
```
icacls C:\ProgramData\ssh\administrators_authorized_keys /inheritance:r /grant "SYSTEM:(F)" /grant "BUILTIN\Administrators:(F)"
```
Vérifiez les points suivants :
1. Le fichier `authorized_keys` doit être dans `C:\Users\
2. Pour le compte administrateur, il doit être dans `C:\ProgramData\ssh\administrators_authorized_keys`
3. Les permissions doivent être strictes — seul l'utilisateur et SYSTEM doivent avoir accès
4. Exécutez :
```
icacls C:\ProgramData\ssh\administrators_authorized_keys /inheritance:r /grant "SYSTEM:(F)" /grant "BUILTIN\Administrators:(F)"
```