How do I connect to my server via SSH?

Not so much experience with virtual machines? Are you just getting started in the public cloud area? In this quick guide I will give you the answer to an essential question that you definitely need to be able to answer: How do I connect to my server?

This article explains how to connect to your cloud server. The whole thing is of course also valid for connecting to other servers, maybe you want to connect to your Raspberry PI or to a dedicated server. The usual network protocol used to establish such a connection is called “SSH” or “Secure Shell” for short. SSH is a secure protocol for establishing an encrypted network connection. The program you use to log in and execute commands on your remote machine is often simply called ssh, but more precisely, it is an SSH client.

In the following sections I will show you briefly how to establish an SSH connection under Linux, Mac or Windows.

Linux & Mac

On Linux and Mac OS X you do not need to install an additional SSH client. The OpenSSH SSH client is already available on both systems. All you need to do is run the Terminal program to get started.

call Terminal

You can find Terminal on the Mac simply by using the Spotlight search in the right corner or in the /Applications/Utilities/ directory.

Under Ubuntu, click the Ubuntu icon in the menu bar and type Terminal in the search field.

establish connection

In the next step you need the IP of the server you want to connect to.

Then execute the following command:

ssh username@IP address

Replace “username” with an existing user account on your server. If you are logging in on your server for the first time and have not yet created a non-root user, log in as user “root”. Replace “IP address” with the IP of your server.

For example, you would log in with the root user on the server with the IP address 177.0.01:

ssh root@177.0.01

Confirm the command with Enter to establish the connection.

Optionally after executing the command you will be asked to confirm the credibility of the host, if everything looks OK, confirm with “yes” to connect or “no” to disconnect.

Depending on whether you use an SSH key or password, the last step of the command will ask you for your user password.

That’s it! If you now see a prompt similar to “root@servername:~#”, you are connected to your server via SSH. When you are done you can end your active session with “exit”.

Windows

Unlike Linux and Mac, there is no pre-installed SSH client available on Windows. A very frequently used SSH client is the program PuTTy.

establish a connection with PuTTy

To run a simple SSH session, open the program and enter the IP address of your server under “Host Name (or IP adress)”, you can leave all other settings untouched. After that you click on “Open” to establish the connection.

putty ssh connection

After the click a new window opens, username and password are requested. If you connect to your server for the first time and have not yet created a non-root user, log in with the username “root” + the corresponding password.

Done! You should now see a prompt similar to “root@servername:~#” and have established an SSH session to your cloud server. With “exit” you can end the active session again.

Conclusion

After learning how to connect via SSH, you now have full control over your cloud server. What you do with your server is up to you. The command line is a powerful tool that gives you far more control than a GUI. The best way to start is to explore the filesystem of your server or install a program that interests you.