# Enable SSH Password Authentication on Windows VM # Run this script as Administrator in the VM # 1. Set password for SupportUser Write-Host "Setting password for SupportUser..." net user SupportUser vos313 # 2. Enable password authentication in sshd_config Write-Host "Enabling password authentication..." $sshdConfig = "C:\ProgramData\ssh\sshd_config" if (Test-Path $sshdConfig) { # Backup original Copy-Item $sshdConfig "$sshdConfig.backup" # Enable password authentication $content = Get-Content $sshdConfig $content = $content -replace '#PasswordAuthentication yes', 'PasswordAuthentication yes' $content = $content -replace 'PasswordAuthentication no', 'PasswordAuthentication yes' $content | Set-Content $sshdConfig Write-Host "Updated sshd_config" } else { Write-Host "sshd_config not found at $sshdConfig" } # 3. Restart SSH service Write-Host "Restarting SSH service..." Restart-Service sshd # 4. Verify service is running Get-Service sshd Write-Host "" Write-Host "SSH setup complete!" Write-Host "Test from host: ssh SupportUser@192.168.100.10"