En plus du RDP, OpenSSH Server permet une administration SSH/SFTP légère sur votre VPS Windows. Utile pour scripts, déploiements et transferts de fichiers.
📋 Prérequis
- VPS Windows Server avec droits administrateur, port 22 (ou personnalisé) autorisé si besoin — voir ouvrir un port pare-feu.
Installer la fonctionnalité
PowerShell en administrateur :
PowerShellGet-WindowsCapability -Online | Where-Object Name -like 'OpenSSH.Server*' Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0
Démarrer et activer le service
PowerShellStart-Service sshd Set-Service -Name sshd -StartupType Automatic Get-Service sshd
Pare-feu Windows
La règle est souvent créée automatiquement. Sinon :
PowerShellNew-NetFirewallRule -Name "OpenSSH-Server-In-TCP" -DisplayName "OpenSSH Server (TCP 22)" -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22
Tester depuis votre PC
Remplacez IP_DU_VPS et l’utilisateur Windows :
Bashssh utilisateur@IP_DU_VPS
SFTP : sftp utilisateur@IP_DU_VPS
Sécurité
- Préférez les clés SSH aux mots de passe.
- Limitez les comptes autorisés ; évitez Administrator si possible.
- Combinez avec configuration initiale et mises à jour régulières.
Bonne administration ! 🚀