Compare commits
10 Commits
6435f5e823
...
e7a798c937
| Author | SHA1 | Date | |
|---|---|---|---|
| e7a798c937 | |||
| add4cc4455 | |||
| 65cdeb8d5e | |||
| c35a04a807 | |||
| 096c42053c | |||
| 9055ccf635 | |||
| ca2f43e616 | |||
| 44557356a6 | |||
| 9da3b534a1 | |||
| 22f20d7c46 |
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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."
|
||||
}
|
||||
@ -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
48
bin/archive/InstallSSH.bat
Executable 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
|
||||
Reference in New Issue
Block a user