From 2f527c84ea1d18a545a7409c6cf551284ad0c18d Mon Sep 17 00:00:00 2001 From: Luk Lu Date: Sun, 8 Aug 2021 13:21:51 +0800 Subject: [PATCH] u --- install-OpenSSH-runas-Administrator.bat | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 install-OpenSSH-runas-Administrator.bat diff --git a/install-OpenSSH-runas-Administrator.bat b/install-OpenSSH-runas-Administrator.bat new file mode 100755 index 0000000..4ced001 --- /dev/null +++ b/install-OpenSSH-runas-Administrator.bat @@ -0,0 +1,17 @@ +REM 介绍 https://winscp.net/eng/docs/guide_windows_openssh_server#installing_sftp_ssh_server +REM 下载 https://github.com/PowerShell/Win32-OpenSSH/releases +REM open a CMD or PowerShell as Administrator, then run this bat. + +cd C:\bin\OpenSSH-Win64 + +powershell.exe -ExecutionPolicy Bypass -File .\install-sshd.ps1 + +.\ssh-keygen.exe -A + +powershell.exe -ExecutionPolicy Bypass -File .\FixHostFilePermissions.ps1 + +REM Windows 8 and 2012 or newer only: +powershell.exe New-NetFirewallRule -Protocol TCP -LocalPort 22 -Direction Inbound -Action Allow -DisplayName SSH + +sc config sshd start=auto +sc start sshd