Some checks failed
Test / test (push) Has been cancelled
- Includes complete dockurr/windows source (not just FROM image) - Added openssh-client and sshpass to Dockerfile - Added SSH key for Windows VM access - Added VPN automation scripts (vpn-login.js, socks5.js, vpn.bat) - Added Windows setup scripts (install-nodejs.ps1, setup-autologin-sshd.ps1, setup-ssh-keys.ps1) - Added rego-startup.sh for script deployment and network setup - Scripts auto-copy to shared folder on container start 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
45 lines
1.8 KiB
PowerShell
45 lines
1.8 KiB
PowerShell
# Setup OpenSSH Server and Auto-Login for alexz
|
|
# Run as Administrator in PowerShell
|
|
|
|
$Username = "alexz"
|
|
$Password = "Az@83278327$$@@"
|
|
|
|
Write-Host "=== Setting up OpenSSH Server ===" -ForegroundColor Cyan
|
|
|
|
# Install OpenSSH Server
|
|
$sshCapability = Get-WindowsCapability -Online | Where-Object Name -like 'OpenSSH.Server*'
|
|
if ($sshCapability.State -ne 'Installed') {
|
|
Write-Host "Installing OpenSSH Server..." -ForegroundColor Yellow
|
|
Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0
|
|
} else {
|
|
Write-Host "OpenSSH Server already installed" -ForegroundColor Green
|
|
}
|
|
|
|
# Start and enable SSH service
|
|
Write-Host "Starting SSH service..." -ForegroundColor Yellow
|
|
Start-Service sshd
|
|
Set-Service -Name sshd -StartupType 'Automatic'
|
|
|
|
# Configure firewall
|
|
$fwRule = Get-NetFirewallRule -Name "OpenSSH-Server-In-TCP" -ErrorAction SilentlyContinue
|
|
if (-not $fwRule) {
|
|
Write-Host "Adding firewall rule..." -ForegroundColor Yellow
|
|
New-NetFirewallRule -Name 'OpenSSH-Server-In-TCP' -DisplayName 'OpenSSH Server (sshd)' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22
|
|
}
|
|
|
|
Write-Host "OpenSSH Server configured!" -ForegroundColor Green
|
|
|
|
Write-Host ""
|
|
Write-Host "=== Setting up Auto-Login ===" -ForegroundColor Cyan
|
|
|
|
$RegPath = "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon"
|
|
Set-ItemProperty -Path $RegPath -Name "AutoAdminLogon" -Value "1"
|
|
Set-ItemProperty -Path $RegPath -Name "DefaultUserName" -Value $Username
|
|
Set-ItemProperty -Path $RegPath -Name "DefaultPassword" -Value $Password
|
|
Remove-ItemProperty -Path $RegPath -Name "DefaultDomainName" -ErrorAction SilentlyContinue
|
|
|
|
Write-Host "Auto-login configured for '$Username'!" -ForegroundColor Green
|
|
Write-Host ""
|
|
Write-Host "Setup complete! SSH is now available and auto-login is enabled." -ForegroundColor Green
|
|
Write-Host "Reboot to test auto-login." -ForegroundColor Yellow
|