SSH (Secure Socket Shell) is a network protocol that can be used to securely access other machines across a network. From our perspective, using SSH can be valuable, especially if you’re looking to interact with Linux virtual machines such as Matillion servers. For example, SSH protocols could be used to:
- Log into a Linux virtual machine
- Copy files to/from a Linux virtual machine
- Generate SSH keys that can be used for SSH authentication
- Configure authentication to a remote Git repository without entering a password each time you push, pull, etc.
How to Enable SSH Commands in Windows 10
In Windows 10, SSH commands can be executed through PowerShell natively; however, the functionality must be enabled by following these steps:
Open the START menu and open Manage optional features:
Select Add a feature:
Search for SSH and install both the OpenSSH Client and the OpenSSH Server:
Restart your machine (or sign out and in again) to automatically add the set of SSH commands to your PATH environment variable. You should now be able to execute the ssh command from PowerShell:
If you see the usage message above, you can stop here and everything is set up. If not, you may have an error similar to the following:
If you see this error, keep reading to add the commands to your PATH environment variable directly.
Adding the OpenSSH Commands to Your PATH Environment Variable
Open the START menu and open Edit the system environment variables:
Select Environment Variables:
Select your Path system variable and select Edit:
Select to add a New variable and enter the location of the OpenSSH folder as a variable. By default, this should be C:\Windows\System32\OpenSSH
. Then hit OK a few times to close the various menus:
You should now be able to execute the ssh command from PowerShell:
Congratulations! You now have a working SSH command that could be used to do a variety of things, as mentioned at the top of this post:
- Log into a Linux virtual machine
- Copy files to/from a Linux virtual machine
- Generate SSH keys that can be used for SSH authentication
- Configure authentication to a remote Git repository without entering a password
Check back next week for another post that builds upon this one!