← 返回所有文章

SSH(Windows)

UtilsSSHWindowssshd_config作者:VincentCorgi約 1 分鐘閱讀

功能

說明 Windows 上啟用 OpenSSH Server 時,於 sshd_config 設定 密碼登入AllowUsers 等,以及服務重啟要點。

情境

  • 要在 Windows 主機用 SSH 遠端登入(取代或補充 RDP)、或限制只有特定帳號可連線時,依下列步驟設定。
  1. 建立 user
  2. C:\ProgramData\ssh\sshd_configPasswordAuthentication yes,底下加:
Code
AllowUsers <username>

Match User <username>
PasswordAuthentication yes
  1. 重開 ssh
Code
Restart-Service sshd
  1. 測試
Code
ssh <username>@<host> -p <port>