Hack Forums
Enable SSH in Windows 10 Using PowerShell - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Hacks, Exploits, and Various Discussions (https://hackforums.net/forumdisplay.php?fid=45)
+--- Forum: Grayhat • Purple Team • Hybrid Security (https://hackforums.net/forumdisplay.php?fid=449)
+---- Forum: Beginner Hacking (https://hackforums.net/forumdisplay.php?fid=4)
+----- Forum: Hacking Tutorials (https://hackforums.net/forumdisplay.php?fid=47)
+----- Thread: Enable SSH in Windows 10 Using PowerShell (/showthread.php?tid=6281762)



Enable SSH in Windows 10 Using PowerShell - Clumsy - Oct 8, 2024

Here is a 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.

Code
# 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



RE: Enable SSH in Windows 10 Using PowerShell - Biggy_Asian - Oct 8, 2024

Oooooh veryyy handy I have a few idea in mind with this. Thanks


RE: Enable SSH in Windows 10 Using PowerShell - Jinu - Oct 16, 2024

Thanks for sharing this script! Personally, I find enabling OpenSSH incredibly useful for remote server management. It makes it much easier to connect securely and manage files or applications without being physically present. This will definitely save me time and effort.


RE: Enable SSH in Windows 10 Using PowerShell - cam667 - Oct 28, 2024

also I needed it for a friend thank you very much


RE: Enable SSH in Windows 10 Using PowerShell - preddt - Nov 25, 2024

Very interesting, thanks for the info.


RE: Enable SSH in Windows 10 Using PowerShell - Hopsin - Nov 26, 2024

Thanks for your contribution! Keep it up.