Hi, I'm going to share simple script using PowerShell to enable OpenSSH
1. Press the windows start key and run PowerShell as admin or you can do Windows key and X at the same time to do it.
2. Now run the following script below and you are done.
Enjoy, posts written by me can be used for educational purposes or authorized use.
1. Press the windows start key and run PowerShell as admin or you can do Windows key and X at the same time to do it.
2. Now run the following script below and you are done.
PHP Code:
[hide]# Ensure script runs as administrator
if (-not ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator"))
{
Write-Host "This script needs to be run as Administrator!" -ForegroundColor Red
exit
}
# Install OpenSSH Server feature
Write-Host "Installing OpenSSH Server..." -ForegroundColor Yellow
Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0
# Start the OpenSSH Server service
Write-Host "Starting OpenSSH Server..." -ForegroundColor Yellow
Start-Service -Name sshd
# Set OpenSSH Server to start automatically on boot
Write-Host "Configuring OpenSSH Server to start on boot..." -ForegroundColor Yellow
Set-Service -Name sshd -StartupType 'Automatic'
# Allow SSH through the firewall
Write-Host "Allowing SSH through Windows Firewall..." -ForegroundColor Yellow
New-NetFirewallRule -Name "OpenSSH-Server-In-TCP" -DisplayName "OpenSSH Server (SSH-In)" -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22
Write-Host "Made By ClumsyLulz" -ForegroundColor Green
Write-Host "OpenSSH Server installation and configuration complete!" -ForegroundColor Green[/hide]
Code:
https://pastebin.com/sfJRGK91
Enjoy, posts written by me can be used for educational purposes or authorized use.
Clicking the like button 💓 will motivate to share more HQ Posts
Not ratedThis leak has not been rated yet, be careful when downloading.