Compare commits

...

10 Commits

Author SHA1 Message Date
e7a798c937 . 2025-04-25 13:24:58 +01:00
add4cc4455 . 2024-09-02 19:34:11 +01:00
65cdeb8d5e . 2023-10-03 18:24:45 +01:00
c35a04a807 . 2023-09-27 21:12:01 +01:00
096c42053c . 2023-09-27 21:10:35 +01:00
9055ccf635 . 2023-09-27 21:05:01 +01:00
ca2f43e616 . 2023-09-27 20:51:17 +01:00
44557356a6 . 2023-09-27 20:49:34 +01:00
9da3b534a1 . 2023-09-27 20:41:50 +01:00
22f20d7c46 update to latest openssh 2023-09-27 20:30:09 +01:00
6 changed files with 81 additions and 11 deletions

View File

@ -1,3 +1,6 @@
Run InstallSSH.bat in an Administrator command prompt
1) Download zip of repo
2) mkdir C:\wPublic
3) Unpack wPublic to C:\wPublic
4) Start command prompt in ADMINISTRATOR mode
5) Run C:\wPublic\bin\InstalSSh.bat in the above command prompt

0
asdqwe Normal file
View File

View File

@ -1,4 +1,5 @@
$source = "https://github.com/PowerShell/Win32-OpenSSH/releases/download/v8.9.1.0p1-Beta/OpenSSH-Win64.zip"
$source = "https://github.com/PowerShell/Win32-OpenSSH/releases/download/v9.2.2.0p1-Beta/OpenSSH-Win64.zip"
$destination = "C:\Packages\OpenSSH-Win64.zip"
Invoke-WebRequest -Uri $source -OutFile $destination

View File

@ -1,3 +1,15 @@
New-NetFirewallRule -Name sshd -DisplayName 'OpenSSH Server (sshd)' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22
# New-NetFirewallRule -Name sshd -DisplayName 'OpenSSH Server (sshd)' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22
Set-Service sshd -StartupType Automatic
Start-Service sshd
# OPTIONAL but recommended:
Set-Service -Name sshd -StartupType 'Automatic'
# Confirm the Firewall rule is configured. It should be created automatically by setup. Run the following to verify
if (!(Get-NetFirewallRule -Name "OpenSSH-Server-In-TCP" -ErrorAction SilentlyContinue | Select-Object Name, Enabled)) {
Write-Output "Firewall Rule 'OpenSSH-Server-In-TCP' does not exist, creating it..."
New-NetFirewallRule -Name 'OpenSSH-Server-In-TCP' -DisplayName 'OpenSSH Server (sshd)' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22
} else {
Write-Output "Firewall rule 'OpenSSH-Server-In-TCP' has been created and exists."
}

View File

@ -9,6 +9,7 @@ mkdir %PACKAGES%
call %WPUBLIC%\bin\SpeedUpPS.bat
echo "------- attempting uninstall first"
set PSFILE="C:\Program Files\OpenSSH\uninstall-sshd.ps1"
if exist %PSFILE% (
echo "SSH uninstall script"
@ -18,27 +19,32 @@ if exist %PSFILE% (
del /f/s/q "C:\Program Files\OpenSSH\*.*"
rmdir /s/q "C:\Program Files\OpenSSH"
del /f/s/q "C:\Packages\openssh-portable-9.2.2.0\*.*"
rmdir /s/q "C:\Packages\openssh-portable-9.2.2.0"
del /f/s/q "C:\Packages\OpenSSH-Win64\*.*"
rmdir /s/q "C:\Packages\OpenSSH-Win64"
echo "Download and unpack OpenSSH"
echo "------- Download and unpack OpenSSH"
set PSFILE="%WPUBLIC%\bin\Download.ps1"
Powershell.exe -ExecutionPolicy Bypass -File %PSFILE%
if exist "C:\Program Files\OpenSSH\sshd.exe" (
echo "OPENSSH already installed"
)
else (
@REM if exist "C:\Program Files\OpenSSH\sshd.exe" (
@REM echo "OPENSSH already installed"
@REM )
@REM else (
echo "NEW installation"
robocopy "%PACKAGES%\OpenSSH-Win64" "C:\Program Files\OpenSSH" /E
)
@REM )
echo "------- attempting install"
set PSFILE="C:\Program Files\OpenSSH\install-sshd.ps1"
if exist %PSFILE% (
echo "SSH install script"
Powershell.exe -ExecutionPolicy Bypass -File %PSFILE%
)
echo "------- fix firewall"
set PSFILE="%WPUBLIC%\bin\Firewall.ps1"
if exist %PSFILE% (
Powershell.exe -ExecutionPolicy Bypass -File %PSFILE%

48
bin/archive/InstallSSH.bat Executable file
View File

@ -0,0 +1,48 @@
@echo off
set check_computername=%COMPUTERNAME%
echo "Found computer %check_computername%"
set PACKAGES="C:\Packages"
set WPUBLIC="C:\wPublic"
mkdir %PACKAGES%
call %WPUBLIC%\bin\SpeedUpPS.bat
set PSFILE="C:\Program Files\OpenSSH\uninstall-sshd.ps1"
if exist %PSFILE% (
echo "SSH uninstall script"
Powershell.exe -ExecutionPolicy Bypass -File %PSFILE%
)
del /f/s/q "C:\Program Files\OpenSSH\*.*"
rmdir /s/q "C:\Program Files\OpenSSH"
del /f/s/q "C:\Packages\OpenSSH-Win64\*.*"
rmdir /s/q "C:\Packages\OpenSSH-Win64"
echo "Download and unpack OpenSSH"
set PSFILE="%WPUBLIC%\bin\Download.ps1"
Powershell.exe -ExecutionPolicy Bypass -File %PSFILE%
if exist "C:\Program Files\OpenSSH\sshd.exe" (
echo "OPENSSH already installed"
)
else (
echo "NEW installation"
robocopy "%PACKAGES%\OpenSSH-Win64" "C:\Program Files\OpenSSH" /E
)
set PSFILE="C:\Program Files\OpenSSH\install-sshd.ps1"
if exist %PSFILE% (
echo "SSH install script"
Powershell.exe -ExecutionPolicy Bypass -File %PSFILE%
)
set PSFILE="%WPUBLIC%\bin\Firewall.ps1"
if exist %PSFILE% (
Powershell.exe -ExecutionPolicy Bypass -File %PSFILE%
net start sshd
)
curl.exe --output C:\BaseGitClone.bat --url https://mint.nopenso.com/mirror/wBase/raw/branch/main/BaseGitClone.bat