Daily Archives: February 29, 2024

Using OpenSSH and SSH on Windows

Published by:

Secure Shell software allowing connections between clients and servers for remote administration.

Related Powershell Commands:
Check the installation status
Get-WindowsCapability -Online | Where-Object Name -like 'OpenSSH*'

Start the service
Start-Service sshd

Change the service startup behaviour
Set-Service -Name sshd -StartupType 'Automatic'

Add/Install the service
Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0
Local Tunneling allows a port on your local client machine to act as a port on the remote server.
Jump to remote tunnel at 7m 43 secs
Useful Commands to show the logged in user account etc:

tasklist /s <pcname> /fi "imagename eq explorer.exe" /v

wmic /node: <pcname> computersystem get username

wmic /node: <pcname> computersystem get manufacturer, model, username

Or locally:
wmic computersystem get manufacturer, model, username

Change the Network Hostname (Requires Admin account)
Using CMD
wmic computersystem where name="%COMPUTERNAME%" rename "NewName"

Use Powershell and CMD to switch between sessions on either command line  

Using Powershell
Rename-Computer "NewName" -Restart