DevOps

SSH into Linux from Windows with this Simple Tutorial

SSH, or Secure Shell, is a network protocol used for secure communication between two remote machines. Linux is a popular operating system that is often accessed remotely through SSH. Windows 11 now comes with a built-in SSH client that can be used to connect to Linux machines. In this blog post, we will discuss how to SSH to Linux from Windows 11 using PowerShell.

Step 1: Enable the SSH client in Windows 11 First, you need to ensure that the SSH client is enabled in Windows 11. To do this, follow these steps:

  1. Open the Windows PowerShell as an administrator.
  2. Type the following command:
Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0

This command will enable the OpenSSH client on your Windows 11 machine.

Step 2: Obtain the IP address of the Linux machine Before you can connect to the Linux machine, you need to obtain its IP address. You can do this by logging into the Linux machine and running the following command:

ip addr show

This will show you the IP address of the Linux machine.

Step 3: Connect to the Linux machine using SSH Now that you have the IP address of the Linux machine, you can connect to it using SSH. To do this, follow these steps:

  1. Open the Windows PowerShell as an administrator.
  2. Type the following command, replacing <username> with your Linux username and <ip address> with the IP address of your Linux machine:
ssh <username>@<ip address>
  1. Press Enter. You will be prompted to enter your Linux password. Type your password and press Enter.
    • If this is the first time you are connecting to the Linux machine, you will be prompted to accept the SSH key fingerprint. Type “yes” and press Enter to continue.

If everything is configured correctly, you should now be connected to your Linux machine via SSH.

Step 4: Disconnect from the Linux machine To disconnect from the Linux machine, simply type the following command:

exit

This will terminate the SSH connection and return you to the Windows PowerShell prompt.

There you have it, SSH is a powerful tool for remotely accessing and managing Linux machines.