![PowerShell Remote SSH Techhyme](https://techhyme.com/wp-content/uploads/2023/07/PowerShell-Remote-SSH-Techhyme-1024x568.jpg)
PowerShell Remoting allows you to execute PowerShell commands or scripts on remote computers. It enables you to manage and administer remote systems from a single computer.
PowerShell Remoting provides various useful features like background jobs, remote script execution, and remote module management. You can learn more about these features and additional remoting cmdlets in the official PowerShell documentation.
Also Read: PowerShell Books
Remember, PowerShell Remoting requires administrative privileges and proper network connectivity between the local and remote computers. Ensure that you have the necessary permissions and firewall rules configured to establish remote connections.
Assuming you are on Windows 10 with PowerShell 7 installed. Lets verify it once.
Command: Get-Host | Select-Object Version
As you can see that, the current PowerShell version is 5 but for PowerShell Remoting, your minimum version should be 7 at least.
So download the PowerShell 7 version from GitHub repository.
Extract the folder
And run pwsh.exe file by double clicking on it.
Now verify the version of PowerShell by running the following command:
Command: Get-Host | Select-Object Version
To get a list of all available commands, you can run:
Command: Get-Command
dd
To make a connection from Windows machine to Linux machine, the command is:
Command: New-PSSession -Hostname 192.168.1.13 -UserName techhyme
If you try to make a SSH session with Linux machine you may receive an error message like this.
New-PSSession: [192.168.1.13] The SSH Client session has ended with error message: The SSH transport process has abruptly terminated causing this remote session to break.
Next step is to install Open SSH client and server on Windows 10.
Lets use the PowerShell utility Add-WindowsCapabillity and run the commands.
Command: Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0
Command: Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0
Once OpenSSH is installed successfully, you need to start the OpenSSH Services by running the following command:
Command: Start-Service sshd
If you want to start the “sshd” service automatically when the computer boots up, then the command is:
Command: Set-Service sshd -StartupType Automatic
Now, Edit the OpenSSH configuration sshd_config located in C:\Windows\System32\OpenSSH or you can find it in C:\ProgramData\ssh\sshd_config by adding Subsystem for PowerShell.
Subsystem powershell pwsh.exe -sshs -NoLogo -NoProfile
Also make sure OpenSSH configuration file sshd_config has PasswordAuthentication set to yes.
Restart the service by using:
Command: Get-Service -Name sshd | Restart-Service
SSH remoting is now properly set on your Windows Machine.
You may also like:- Essential Commands For Process Management in Kali Linux
- How To Install Python 2.7.18 From The Source
- How To Parse SSH Authentication Logs with Logstash
- A Comprehensive Guide to File System Commands in Linux
- Essential File Compression Commands in Linux
- Secure Shell (SSH) Protocol – A Comprehensive Guide
- Monitoring Active Connections in Kali Linux Using Netstat
- How To Easily Crack Wi-Fi Password
- 6 Most Useful Windows Command Prompt Commands
- Ripgrep – Searching for Specific File Types and Beyond