---
title: "Mastering SSH Commands in Linux for Windows Admins"
description: "Windows admins learning Linux can become proficient in using SSH commands with this informative blog post."
canonical: "https://adamtheautomator.com/ssh-command-in-linux/"
---

# Mastering SSH Commands in Linux for Windows Admins

> Windows admins learning Linux can become proficient in using SSH commands with this informative blog post.

Source: https://adamtheautomator.com/ssh-command-in-linux/

---

ATA Learning

Tap to hide

[

ATA Learning

](/)

*   [Home](/)
*   [Tutorials](/tutorials/)
*   [Instructors](/author/)
*   [Advertising](/advertising/)
*   [Recommended Resources](/resources/)
*   [About Adam](/about-adam/)

Search for:  

*   [](https://twitter.com/adbertram)
*   [](https://github.com/Adam-the-Automator)
*   [](https://www.linkedin.com/company/adam-the-automator-llc)
*   [](/feed/)

![Mastering SSH Commands in Linux for Windows Admins](https://adamtheautomator.com/wp-content/uploads/2020/11/Windows-Guy-in-Linux-World-2.jpg)

# Mastering SSH Commands in Linux for Windows Admins

[![](https://secure.gravatar.com/avatar/d651a7bb1f4308be67d95c5cb50560ed0ee3e700256bd027cb08fbea6655b457?s=192&d=mm&r=g)Christopher Bisset](https://adamtheautomator.com/author/christopher-b/)3 December 20208 min. read

Categories: [IT Ops](/category/it-ops/)

Tags:[Linux](/tag/linux/)

Table of Contents

*   [Moving Away From the Desktop Environment](#h-moving-away-from-the-desktop-environment)
*   [SSH: The Gold Standard of Remote Management](#h-ssh-the-gold-standard-of-remote-management)
*   [Using SSH Commands in Linux](#h-using-ssh-commands-in-linux)
*   [Allowing SSH Through the Firewall](#h-allowing-ssh-through-the-firewall)
*   [Connecting to Linux from Windows](#h-connecting-to-linux-from-windows)
*   [Enabling Mouse Support in SSH with Windows](#h-enabling-mouse-support-in-ssh-with-windows)
*   [Overriding the Default SSH Client](#h-overriding-the-default-ssh-client)
*   [Managing Disconnected Sessions with Tmux](#h-managing-disconnected-sessions-with-tmux)
*   [Enabling tmux on Login](#h-enabling-tmux-on-login)
*   [Wrap Up](#h-wrap-up)

Linux and Windows used to be mortal enemies but nowadays, they tend to get along much better. [In fact, now you can even use SSH natively in Windows: both as a client and a server](https://adamtheautomator.com/powershell-ssh/). What do you do when you’re a Windows admin but need to also manage Linux machines? You get used to (Secure Shell) SSH command in Linux!

> _This is Part IV in the blog post series A Windows Guy in a Linux World. If you’d like to learn more about popular Linux concepts, be sure check out [Part I](https://adamtheautomator.com/yast/), [Part II](https://adamtheautomator.com/linux-file-permissions/), and [Part III](https://adamtheautomator.com/midnight-commander-linux/)._

In this post, you’re going to learn all about how to enable SSH in Linux, and how to set up your Windows SSH client to connect to remote Linux servers.

> _Note: All examples will be using [OpenSUSE Linux](https://software.opensuse.org/)._

## Moving Away From the Desktop Environment

Back in the first [post](https://adamtheautomator.com/yast/) of this series, the tutorial recommended using the KDE desktop environment. As you were going through the OpenSUSE setup, you probably saw another enticing option; the server edition of OpenSUSE.

![Server Edition of OpenSUSE](https://adamtheautomator.com/wp-content/uploads/2020/11/Untitled-2020-11-21T162039.566.png)

Server Edition of OpenSUSE

If you have installed the server edition of most Linux distributions (including OpenSUSE), you may have noticed the complete lack of a desktop. The Server edition of most popular distributions (like OpenSUSE, as well as Ubuntu Server and CentOS) is like [Windows Server Core](https://docs.microsoft.com/en-us/windows-server/administration/server-core/what-is-server-core): no desktop to speak of.

To understand why the desktop is typically shunned in the Linux culture, you need to understand the CLI and SSH.

## SSH: The Gold Standard of Remote Management

SSH, like many other remote management protocols, is a client-server based system. A client remotely connects over the network to a server and allows you to run commands (or even transfer files). SSH is the de facto standard when it comes to managing Linux remotely.

Since SSH has been around for a long time and is deeply embedded in the Linux ecosystem, command-line administration utilities dominate the Linux server environment. Most [Linux server distributions](https://www.tecmint.com/10-best-linux-server-distributions/) do not have a graphical interface.

### Using SSH Commands in Linux

Enough talk. Let’s see what SSH can do by first enabling it in OpenSUSE Linux. To do, use the [YaST](https://adamtheautomator.com/yast/) package manager. To enable SSH with YaST in OpenSUSE:

1.  Click on the start menu, type _terminal_ and choose _Konsole_ assuming you’ve installed the KDE Desktop Manager when installing OpenSUSE.
2.  In the terminal, open YaST by running `sudo yast`.
3.  Once in YaST, arrow down to **system**, then arrow over to **services manager** and press Enter to proceed.
4.  Arrow down to **sshd,** and press `alt+s` to start the SSH service.
5.  Press `alt+r` to change the start mode from manual to on boot. This will ensure the SSH server service is started even after a reboot.
6.  Press `alt+o` to `ok` the changes and apply them.

You can see these steps in action below.

![Using YaST from the command line to enable SSH](https://adamtheautomator.com/wp-content/uploads/2020/11/YrH9ixIJFl.gif)

Using YaST from the command line to enable SSH

## Allowing SSH Through the Firewall

Nearly every Linux distribution comes with some kind of firewall to protect it as Windows does. You can read about OpenSUSE’s firewall [here](https://en.opensuse.org/Firewalld). To ensure you can access the SSH service remotely from Window, you must allow it through the firewall. To do that:

1.  Still in the terminal, start YaST again with `sudo yast`.
2.  Arrow down to **Security and Users** and then arrow over to **Firewall** and press Enter to proceed.
3.  Navigate to **Zones** –> **Public** and arrow over to the **Services—Ports** pane on the right.
4.  Arrow down to find `ssh` in the services.
5.  Select `ssh` with the spacebar and press `alt+d` to add the selection.
6.  Press `alt+a` to accept the changes.

You can see all of these steps above represented visually below.

![Using YaST from the command line to let SSH through the firewall](https://adamtheautomator.com/wp-content/uploads/2020/11/9ardo6VkH8.gif)

Using YaST from the command line to let SSH through the firewall

> _Just like Windows, Linux has different trust levels to apply firewall rules. These levels are referred to as zones. Windows has public, work, and private zones by default. Linux has many more, but defaults to the public zone._

### Connecting to Linux from Windows

Luckily, these days, Windows 10 has a built-in SSH client. To connect to a Linux host, open up a command prompt (cmd) or PowerShell console and specify the username to connect with and the IP or hostname.

```powershell
> ssh <username>@<ip address>
```

If all goes well, the SSH client should ask you to accept a [fingerprint](https://superuser.com/questions/421997/what-is-a-ssh-key-fingerprint-and-how-is-it-generated). A fingerprint is an identifier to make sure someone hasn’t hijacked the target IP address.

> _If you’re running Windows 7, you can still SSH to your Linux host. You’ll just need to download the Microsoft SSH client from [here](https://github.com/PowerShell/Win32-OpenSSH/releases). This SSH client is the same one Windows 10 uses._

Once you type `yes` and put in your password you’re connected to your server! You can now use the command line just as if we were opening a terminal on the computer itself.

> _Do not expose SSH (default port 22) to the Internet through your router. Bots crawl the Internet **constantly** looking for open SSH ports. As soon as a bot finds an open port, they’ll start spamming passwords trying to brute force their way in._

## Enabling Mouse Support in SSH with Windows

One of the big drawbacks of using the native Windows 10 SSH client (at least at the time of this writing) is the lack of mouse support. This means you can’t use a mouse in [midnight commander](https://adamtheautomator.com/midnight-commander-linux/) as you learned in a previous blog post.

Luckily, as of [version eight of the OpenSSH Windows client](https://github.com/PowerShell/Win32-OpenSSH/releases), you can get mouse support! Let’s get this client installed.

1.  Download the latest release of OpenSSH-Win64 [from here](https://github.com/PowerShell/Win32-OpenSSH/releases) and extract the resulting zip file. The tutorial will assume you extract it to _~\\Downloads\\OpenSSH-Win64_.
2.  Open a PowerShell console and navigate _~\\Downloads\\OpenSSH-Win64_ with `cd ~\Downloads\OpenSSH-Win64`.
3.  Check the SSH client version by running `.\\ssh -V`. As of writing this guide, the version should be 8.1.0.0-p1.
4.  SSH into your Linux server by using `.\ssh <user>@<ip>`.
5.  Once logged in, test mouse support by running `mc` to run [midnight commander](https://adamtheautomator.com/midnight-commander-linux/) to ensure you can use a mouse.

You can see all of these steps above represented visually below.

![version eight of the OpenSSH Windows client](https://adamtheautomator.com/wp-content/uploads/2020/11/HDlkRvEiNo.gif)

[version eight of the OpenSSH Windows client](https://github.com/PowerShell/Win32-OpenSSH/releases)

### Overriding the Default SSH Client

If you want to use the new version on a more permanent basis, you can; but you must override the default Windows 10 SSH client. This ensures whenever you run _ssh_ on the command line, the newer version (with mouse support) is used.

Assuming you’ve got the client extracted to the _~\\Downloads\\OpenSSH-Win64_ folder

1.  Move the extracted OpenSSH-Win64 folder to a permanent folder of your choice. This tutorial will use _C:\\users\\public\\OpenSSH-Win64_.
2.  Go to **Start** and then **Run** and type _sysdm.cpl_ or, open up **System** from the control panel.
3.  Under the **Advanced** tab, click **Environment Variables**.
4.  Under **System Variables**, click on **Path**.
5.  Click on **New** to add a new path and provide the folder path to the SSH client (_C:\\users\\public\\OpenSSH-Win64_ in this case).
6.  Click **Move Up** until it’s above the _%SystemRoot%\\system32_ folder. This will ensure whenver you type `ssh` on the command line, Windows will look here first.
7.  Open up a PowerShell console and run `ssh -V`. You should see the version to be at _8.1.0.0-p_.

These steps are summarized below.

![Overriding the Default SSH Client](https://adamtheautomator.com/wp-content/uploads/2020/11/Untitled-2020-11-21T162949.423.png)

Overriding the Default SSH Client

Prioritizing a folder over _%SystemRoot%\\system32 can_ be a security risk. If someone has access to your computer, they can decide to insert a virus in the OpenSSH-Win64 folder and name it as a windows utility like _cd.exe_.

You should restrict the OpenSSH-Win64 folder to be read only for anyone except administrators.

1.  Right click on OpenSSH-Win64 folder and click **Properties**.
2.  Under the **Security** tab, click the **Advanced** button.
3.  Click **Disable inheritance** to allow custom folder permissions and to prevent parent folders from overriding permissions in the OpenSSH-Win64 folder.
4.  Choose **Add**, find the **Administrators** group and give them full rights.
5.  Click **Add**, find the **Everyone** group and give them read only permissions.
6.  Select the **Replace all child object permission** checkbox to propagate these settings to all files in the OpenSSH-Win64 folder; click **Apply**.
7.  Now test these permissions by creating a new file in the OpenSSH-Win64 folder. Windows should require an Administrator prompt.

You can see all of these steps above represented visually below.

![restrict the OpenSSH-Win64 folder](https://adamtheautomator.com/wp-content/uploads/2020/11/fP6feCtpp3.gif)

restrict the OpenSSH-Win64 folder

### Managing Disconnected Sessions with Tmux

Ah, what a pain! You’re halfway through running a long-executing command over SSH and your Internet drops out. Now you don’t have a clue what state the Linux server is in! Is it done with that command? How do you get it back?

Disconnected sessions are a legitimate issue with SSH and one that luckily has a straightforward solution. You need a [terminal multiplexer](https://en.wikipedia.org/wiki/Terminal_multiplexer#:~:text=A%20terminal%20multiplexer%20is%20a,reattach%20sessions%20from%20a%20terminal.) (tmux).

> Tmux stands for both the abbreviation of terminal multiplexer, and the name of the program itself

Tmux is a session manager for SSH. It “holds on” to a session if you get disconnected and keeps it running in the background. You can reconnect to that session later or even create multiple sessions and hop between them.

To manage disconnected sessions with tmux:

1.  In the Linux terminal, download and install the [tmux utility](https://en.wikipedia.org/wiki/Tmux) by running `sudo zypper install -y tmux` as seen below:

> _You can use the YaST to download the [tmux utility](https://software.opensuse.org/download.html?project=utilities&package=tmux) also._

![Tmux Utility](https://adamtheautomator.com/wp-content/uploads/2020/11/Untitled-2020-11-21T163308.808.png)

Tmux Utility

> _Most Linux distributions have a different command-line package manager. OpenSUSE uses [zypper](https://en.opensuse.org/Portal:Zypper). Arch uses [pacman](https://wiki.archlinux.org/title/pacman). Ubuntu uses [apt](http://manpages.ubuntu.com/manpages/bionic/man8/apt.8.html). Red Hat uses [dnf](https://opensource.com/article/18/8/guide-yum-dnf) and [yum](https://access.redhat.com/solutions/9934). Thankfully, the syntax for these package managers is fairly similar across the board._

2\. On your Windows computer, open up a PowerShell console and SSH into your Linux server. The tutorial will be using a username of _homelab_ and a Linux server IP of 192.168.134.169.

```powershell
ssh <username>@<ip address>
```

3\. Open tmux by running `tmux` once connected. You should get a green bar at the bottom

4\. Run a command that outputs some text. It doesn’t matter what it is. This tutorial is using _[neofetch](https://github.com/dylanaraps/neofetch)_. You can run `ls` also.

5\. Disconnect the session by closing PowerShell. This action simulates a dropout.

6\. Reconnect to your Linux server again using SSH.

7\. Now reattach to the old session by running `tmux a` You should still see the output of that previous `ls` command. Hooray, no data loss from the disconnect!

You can see all of these steps above represented visually below.

![Managing Disconnected Sessions with a Tmux](https://adamtheautomator.com/wp-content/uploads/2020/11/ag8Q02vrKy.gif)

Managing Disconnected Sessions with a Tmux

> _If you try running the [Midnight Commander utility](https://adamtheautomator.com/midnight-commander-linux/) inside of `tmux`, you might notice you don’t have mouse support. You can fix that by running `mc -x` instead._

#### Enabling tmux on Login

By default, tmux will not be available in all SSH sessions. You can change that by forcing tmux to attach to your SSH session every time you login.

Assuming you’re SSHed to your Linux server:

1.  Open up the[midnight commander](https://adamtheautomator.com/midnight-commander-linux/) utility using mc.

2\. Highlight the _.bashrc_ file and hit **edit**.

> _The `.bashrc` file is a shell (batch) script that runs every time you log in via command line_

3\. Add the below shell script code to the bottom of the text file.

```powershell
if [ -z "$TMUX" ]; then tmux attach -t default || tmux new -s default fi
```

4\. Click **quit** and save when prompted.

5\. Test the tmux auto-attach by disconnecting from your SSH session and rejoining. You should get a green bar at the bottom automatically, indicating you are connected to a `tmux` session!

That’s really just scratching the surface of what `tmux` can do, it’s quite a powerful multitasking program. If you ask any Linux admin what their most used command is, it’s probably `tmux`.

## Wrap Up

That concludes the latest post in the _A Windows Guy in a Linux World_ blog post series. Stay tuned to the ATA blog for the next installing coming up!

Share this article

[Share on X](https://twitter.com/intent/tweet?url=https%3A%2F%2Fadamtheautomator.com%2Fssh-command-in-linux%2F&text=Mastering%20SSH%20Commands%20in%20Linux%20for%20Windows%20Admins)[Share on Facebook](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fadamtheautomator.com%2Fssh-command-in-linux%2F)[Share on LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fadamtheautomator.com%2Fssh-command-in-linux%2F)

## Related Posts

![](https://adamtheautomator.com/wp-content/uploads/2022/09/Practical-Linux-Unix-Tee-Commands-for-the-Linux-Admin.jpg)

### [Master Unix tee Commands for Real-World Linux Admin Tasks](/unix-tee/)

Simplify Linux output management and streamline your workflow with the “Unix tee” command. This tutorial guides you through its practical applications.

![](https://adamtheautomator.com/wp-content/uploads/2024/03/openldap-4.jpg)

### [How to Install and Configure an OpenLDAP Ubuntu Server](/openldap/)

Unlock the power of OpenLDAP on Ubuntu for centralized user authentication, seamless access control management, and enhanced directory services!

![](https://adamtheautomator.com/wp-content/uploads/2024/03/pipe-command-in-linux-1.jpg)

### [Unleashing the Power of the Pipe Command in Linux](/pipe-command-in-linux/)

Unlock the prowess of the pipe command in Linux to streamline tasks, boost productivity, and simplify complex operations effortlessly!

## Categories

*   [IT Ops](/category/it-ops/)
*   [Cloud](/category/cloud/)
*   [DevOps](/category/devops/)
*   [Home Ops](/category/home-ops/)
*   [Information Security](/category/infosec/)
*   [Software Development](/category/software-development/)

## Site

*   [Home](/)
*   [Tutorials](/tutorials/)
*   [Instructors](/author/)
*   [Advertising](/advertising/)
*   [Recommended Resources](/resources/)
*   [About Adam](/about-adam/)

Copyright 2026© ATA Learning | [Privacy Policy](/privacy/)
