JumpServer堡壘機部署與運用之六:Windows部署SSH組件

問題描述

JumpServer會定期對資產列表進行遍歷更新,它會更新主機的資產信息,如CPU、MEM、DISK、操作系統等信息。此功能是基於SSH完成的,因此Linux可以直接獲取到相應的信息,但Windows無法直接獲取信息。
在這裏插入圖片描述

在這裏插入圖片描述

那麼該如何讓Windows也具備相應的信息呢?

問題解決

  1. OpenSSH組件下載
    https://github.com/PowerShell/Win32-OpenSSH/releases/latest

  2. 解壓後,將其重命名到 C:\Program Files\OpenSSH
    在這裏插入圖片描述

  3. 通過管理員身份的方式打開 powershell
    在這裏插入圖片描述

  4. 安裝OpenSSH組件

cd "C:\Program Files\OpenSSH"
powershell.exe -ExecutionPolicy Bypass -File install-sshd.ps1

在這裏插入圖片描述

Windows防火牆配置
New-NetFirewallRule -Name sshd -DisplayName ‘OpenSSH Server (sshd)’ -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22

  1. OpenSSH服務啓動配置
net start sshd
Set-Service sshd -StartupType Automatic

在這裏插入圖片描述

  1. Windows資產增加SSH協議
    在 web 的資產列表裏面找到你的 windows 資產, 在協議組裏面加入 rdp 3389, 再添加一個 ssh 22
    在這裏插入圖片描述

  2. 遠程測試
    ssh 登錄的賬戶密碼與登錄 windows 系統的賬戶密碼一致
    在這裏插入圖片描述
    在這裏插入圖片描述

參考資料

Windows 2019設置OpenSSH組件
https://docs.microsoft.com/en-us/windows-server/administration/openssh/openssh_install_firstuse

Ansible can generally manage Windows versions under current and extended support from Microsoft. Ansible can manage desktop OSs including Windows 7, 8.1, and 10, and server OSs including Windows Server 2008, 2008 R2, 2012, 2012 R2, 2016, and 2019.
https://docs.ansible.com/ansible/latest/user_guide/windows_setup.html

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章