TLDR;
Connect with username and password
ssh user@server-ip
– 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:
- PuTTY: Old school, free and open-source terminal emulator that supports various network protocols, including SSH. It is lightweight and easy to use, making it a popular choice among Windows users.
- To connect using PuTTY, download and install the client from the official website. Enter the server’s IP address and select the SSH protocol. You will then be prompted to enter your username and password.
- Termius: Modern cross-platform SSH client that supports Windows. It offers a modern interface and additional features like encrypted SSH key storage and SFTP support.
Connect via SSH on macOS and Linux
macOS and Linux users have built-in access to SSH through the Terminal application:
- Terminal: The default terminal emulator for these systems. You can open it from the Applications folder / tray.
- Termius: Also available for macOS and Linux users who prefer a more graphical interface with added features.
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.