# 在 Windows 中設定 OpenSSH Server 如果能用 SSH 連上我的 Windows 電腦就好了,但是 Windows 要設定這個東東好麻煩哦 1. 從「選用功能」中開啟 OpenSSH 伺服器 2. 於使用者家目錄放置 `authorized_keys` 並放入公鑰 3. 將 `authorized_keys` 之權限取消繼承並只給予該使用者和 System 完全控制權限 4. 將 `C:\ProgramData\ssh\sshd_config` 最底下的這兩行註解掉 ``` Match Group administrators AuthorizedKeysFile __PROGRAMDATA__/ssh/administrators_authorized_keys ``` 5. 至系統服務管理介面重新啟動 OpenSSH SSH Server 6. 用系統管理員權限在 `powershell` 執行下面指令 ```powershell New-ItemProperty -Path "HKLM:\SOFTWARE\OpenSSH" -Name DefaultShell -Value "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -PropertyType String -Force ``` Credit: https://stackoverflow.com/questions/16212816/setting-up-openssh-for-windows-using-public-key-authentication
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up