JumpServer bastion machine deployment and application six: Windows deployment SSH components

Problem Description

JumpServer will periodically traverse and update the asset list. It will update the asset information of the host, such as CPU, MEM, DISK, operating system and other information. This function is based on SSH, so Linux can directly obtain the corresponding information, but Windows cannot directly obtain the information.
Insert picture description here

Insert picture description here

So how do you make Windows have the corresponding information?

problem solved

  1. OpenSSH component download
    https://github.com/PowerShell/Win32-OpenSSH/releases/latest

  2. After unzipping, rename it to C:\Program Files\OpenSSH
    Insert picture description here

  3. Open powershell as an administrator
    Insert picture description here

  4. Install OpenSSH components

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

Insert picture description here

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

  1. OpenSSH service startup configuration
net start sshd
Set-Service sshd -StartupType Automatic

Insert picture description here

  1. Add SSH protocol to Windows assets
    Find your windows assets in the asset list of the web, add rdp 3389 to the protocol group, and add another ssh 22
    Insert picture description here


  2. The account password for remote test ssh login is the same as the account password for logging in to the windows system
    Insert picture description here
    Insert picture description here

Reference

Windows 2019 set up OpenSSH components
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

Guess you like

Origin blog.csdn.net/weixin_38623994/article/details/107013096
Recommended