SSH(Windows)
- UtilsSSHWindowssshd_config作者:VincentCorgi約 1 分鐘閱讀
功能
說明 Windows 上啟用 OpenSSH Server 時,於 sshd_config 設定 密碼登入、AllowUsers 等,以及服務重啟要點。
情境
- 要在 Windows 主機用 SSH 遠端登入(取代或補充 RDP)、或限制只有特定帳號可連線時,依下列步驟設定。
- 建立 user
- 在
C:\ProgramData\ssh\sshd_config加PasswordAuthentication yes,底下加:
Code
AllowUsers <username>
Match User <username>
PasswordAuthentication yes
- 重開 ssh
Code
Restart-Service sshd
- 測試
Code
ssh <username>@<host> -p <port>