OpenSSH is included in Windows. In this example an installation of Windows 10 21H1 is controlled from a Linux host using Ansible over SSH.
- IP addresses
- SSH key
serve this repo from a webserver on the Linux host
python3 -m http.server
Open cmd.exe and download the files
curl -O http://192.168.0.250:8000/ssh_windows.bat
curl -O http://192.168.0.250:8000/ssh_windows.ps1
Execute bat to configure SSH server.
Now this Windows host can be controlled securely via SSH and Ansible.
ansible-playbook -i hosts.ini install_choco.yml
ansible-playbook -i hosts.ini my.yml
My playbook assumes the Windows user localadmin
has no password and enables login with empty password.
The playbook enables RDP to demonstrate how to use RDP tunneled in SSH.
ssh -L 3389:127.0.0.1:3389 [email protected]
In another window
# dynamic size and scaled to hdpi (choices: 100, 140, 180)
xfreerdp +clipboard /u:localadmin /p:'' /v:127.0.0.1 /dynamic-resolution /scale:180
# fixed size
xfreerdp +clipboard /u:localadmin /p:'' /v:127.0.0.1 /size:1920x1080