Something went wrong. Try again.
Monorepo for Aesthetic.Computer aesthetic.computer
Something went wrong. Try again.
2.1 kB · 48 lines
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849# Setup OpenSSH Server on Windows# Run this in PowerShell as Administrator
Write-Host "🔧 Setting up OpenSSH Server on Windows..." -ForegroundColor Cyan
# Install OpenSSH ServerWrite-Host "`n📦 Installing OpenSSH Server..."Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0
# Start and enable SSH serviceWrite-Host "`n🚀 Starting SSH service..."Start-Service sshdSet-Service -Name sshd -StartupType 'Automatic'
# Configure firewallWrite-Host "`n🔥 Configuring firewall..."if (!(Get-NetFirewallRule -Name "OpenSSH-Server-In-TCP" -ErrorAction SilentlyContinue)) { New-NetFirewallRule -Name 'OpenSSH-Server-In-TCP' -DisplayName 'OpenSSH Server (sshd)' ` -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22}
# Set PowerShell as default shell (optional but recommended)Write-Host "`n🐚 Setting PowerShell as default SSH shell..."New-ItemProperty -Path "HKLM:\SOFTWARE\OpenSSH" -Name DefaultShell ` -Value "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" ` -PropertyType String -Force
# Create .ssh directory for authorized_keys$sshDir = "$env:PROGRAMDATA\ssh"if (!(Test-Path $sshDir)) { New-Item -ItemType Directory -Path $sshDir}
Write-Host "`n✅ OpenSSH Server setup complete!" -ForegroundColor GreenWrite-Host ""Write-Host "Next steps:" -ForegroundColor YellowWrite-Host "1. Copy your public key from the devcontainer:"Write-Host " cat ~/.ssh/id_ed25519.pub # or id_rsa.pub"Write-Host ""Write-Host "2. Add it to: C:\ProgramData\ssh\administrators_authorized_keys"Write-Host " (Create the file if it doesn't exist)"Write-Host ""Write-Host "3. Set proper permissions on administrators_authorized_keys:"Write-Host ' icacls "C:\ProgramData\ssh\administrators_authorized_keys" /inheritance:r'Write-Host ' icacls "C:\ProgramData\ssh\administrators_authorized_keys" /grant SYSTEM:(F)'Write-Host ' icacls "C:\ProgramData\ssh\administrators_authorized_keys" /grant BUILTIN\Administrators:(F)'Write-Host ""Write-Host "Your Windows IP (from container): 172.17.0.1"