SolarDevs

How to SSH to a linux server

TLDR;

Connect with username and password

– then you will be prompted for the password

With username and key

ssh -i key.pem user@server-ip

Option 2: Use Termius if you want a graphical SSH solution

Connecting to a Linux Server via SSH

The most common way to remotely connect ands manage UNIX-like systems. SSH or Secure Shell is a protocol to secure log onto remote systems.

In this guide we will discuss how to use SSH to connect to remote systems.

How to know if a linux server supports SSH connections

By default cloud servers have the SSH server preinstalled, however for on-premise and home servers this is not the case.

Here is the short version to install SSH agents on Debian and RHEL based systems.

Debian / Ubuntu

# install server and client
sudo apt install openssh-server openssh-client
# restart ssh server daemon
sudo systemctl restart sshd

RHEL / CentOs / Fedora

# install server and client
yum -y install openssh-server openssh-clients
# restart ssh server daemon
sudo systemctl restart sshd

Connect via SSH on Windows

Windows users can use several tools to connect to a Linux server via SSH:

Connect via SSH on macOS and Linux

macOS and Linux users have built-in access to SSH through the Terminal application:

To connect using Terminal, open the application and type the command

ssh username@server_ip_address

Replacing username with your actual username and server_ip_address with the IP address of the server. If prompted, enter your password.

In case the SSH server is using key authentication, you can use the following syntax

ssh -i key.pem username@server_ip_address

replacing key.pem with your actual pem file path

There are many more tools that can do the job, but in our experience the terminal is the best way to connect to any server through SSH, followed by Termius.

Conclusion

SSH is an essential tool for managing remote servers securely. Whether you’re using Windows, macOS, or Linux, there are various tools available to help you connect to your Linux server efficiently. Choose the one that suits your needs and preferences best, and enjoy secure access to your server.

Exit mobile version