Last active
April 30, 2024 09:56
-
-
Save fa0311/8abe6f3d856354448a6caf13fa5118b9 to your computer and use it in GitHub Desktop.
Windows を SSH サーバーにするTips
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole("Administrators")) { Start-Process powershell.exe "-File `"$PSCommandPath`"" -Verb RunAs; exit } | |
| Start-Service sshd |
Author
Author
スタートアップに追加
Set-Service -Name sshd -StartupType 'Automatic'
Author
PowerShellに変更
New-ItemProperty -Path "HKLM:\SOFTWARE\OpenSSH" -Name DefaultShell -Value "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -PropertyType String -ForceGit bashに変更
New-ItemProperty -Path "HKLM:\SOFTWARE\OpenSSH" -Name DefaultShell -Value "C:\Program Files\Git\bin\bash.exe" -PropertyType String -Force
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
常時つけっぱなしは怖いけど楽に起動したいからワンクリックで起動するやつ