Linux Server setup

SSH connection under Windows

Not every Windows has an SSH client right on board. Only since an update at the end of 2018 OpenSSH is a fixed part of Windows 10. With OpenSSH we get the ssh command, with which we can establish a connection via the command line or Powershell.

Alternatively, PuTTY can be used. PuTTY is a software that can also do other types of connections, such as Telnet. What is really practical is that profiles can be saved so that you do not have to enter the connection data again and again.

It is still worth having OpenSSH installed. IDEs, editors or database management systems may depend on it to connect directly from the software.

As an alternative client I introduce Cygwin. A software that can also run Unix programs under Windows.


SSH with PuTTY

PuTTY download

First, we download the mini-program from the official download page. At the time of writing, the alt installation file is called: putty-64bit-0.76-installer.msi (64 bit version). Installing PuTTY is nothing special, so I'll omit instructions on how to do it.

When you open PuTTY after installation, you will see the "Session" page:

PuTTY Client

Putty SSH connection

PuTTY's appearance may seem a bit old-fashioned, but the program still does a great job. The more than 20 years old software is cult, where above all the inner values count!

For the connection to our server we don't have to set much at all. We just need the "Session" page, where we enter the following:

  • Host Name (or IP address): 116.203.69.89 (server IP)
  • Port: 22
  • Connection type: SSH
PuTTY: Session settings

That is actually all! It makes sense to name the "Session" and save it, otherwise you would have to enter everything again the next time you start the program. To save just click "Save". An entry appears in the "Saved Sessions" list and with "Load" we can load these settings again.

  • Saved Sessions: 116.203.69.89 (tom) (optional: to save the session)
PuTTY: save session
PuTTY: load session

With a click on "Open" we start the connection setup:

PuTTY: connect

On the very first connection, we are asked whether the new connection is trusted and the address should be added to the list of known servers. Of course, we confirm this with yes.

A black terminal window opens and after a short moment our OpenSSH server asks for our username.

  • Username: tom

If you are surprised that you are typing into the "blank" when entering a password: this is quite normal with Linux. There is no feedback for password entries.

accept unknown server
Putty: login
logged in (welcome message)

There should be a welcome message from the server. If bash displays the logged in user (tom@srv1:~$), then that is a sure sign of a successful login.


SSH via Windows command prompt

As described earlier, you may still need to install OpenSSH to run SSH.

Check for SSH is installed

Let's first open the Windows command prompt:

  • Shortcut WIN+R opens the "Execute" dialog
  • Type cmd and confirm with Enter

With the parameter -V we can query the version from the local SSH:


C:\> ssh -V
 
CMD: check SSH version

If you get the message that this command was not found, you should install OpenSSH. If, on the other hand, a version number is displayed, you can skip the next paragraph "Install OpenSSH".

Install OpenSSH

The software is free and can be downloaded here github.com/PowerShell/Win32-OpenSSH/releases. At the time of writing, the current version is V8.6.0.0p1-Beta (OpenSSH-Win64.zip). After installation, the above test with ssh -V should work.

SSH connection via Windows command-line

With the ssh command we establish a connection. As parameters we specify the user name followed by a @ and the IP address of the server. Without explicit port specification, the default SSH port 22 is taken.

A different port can be specified with the -p parameter. A connection via port 23 would then look like this: ssh root@116.203.69.89 -p 23.

Since our server is freshly set up, we connect to by default:


C:\> ssh tom@116.203.69.89
 

The connection must be confirmed with yes. This is followed by a password prompt. After that, a welcome message should appear, which is a sure sign that the authentication was successful.

SSH via CMD
accept unknown server
login
logged in (welcome message)

SSH with Cygwin Terminal Emulator

The advantage of Cygwin is the possibility to access the local drives in the terminal. For example, the C drive is accessible via /cygdrive/c. The software is free and available from the official Cygwin site. The Cygwin terminal window looks like this:

Cygwin terminal

The connection is established in the same way as before with the Windows command-line:


__$ ssh tom@116.203.69.89
 
SSH via Cygwin
accept unknown server
login
logged in (welcome message)