Connecting to a server via SSH on MacOS

Step-by-step guide to connecting to a server via SSH on MacOS

SSH (Secure Shell) is a cryptographic network protocol used to secure communication between computers. It allows you to remotely access and control a server using a secure connection. This guide will show you how to connect to a server via SSH on a MacOS device.

Requirements

To connect via SSH on a MacOS device, you will need:

1. SSH client: A program that allows you to establish an SSH connection with the server. On MacOS, the built-in Terminal application can be used for this purpose.

2. Server details: The IP address or hostname of the server you want to connect to, as well as its SSH port number (usually 22).

3. SSH credentials: The username and password of the account you want to use to log in to the server.

Connecting from a standard console

The easiest way to connect to the server via SSH is to use the classic client from the console with the ssh login@server_IP command. If you are connecting to the server from this computer for the first time, you will receive a warning that you are trying to connect to an unknown host. Just enter yes:

Next, you will be asked for your account password. Enter the password, after successful authorization you will be redirected to the console of your server:

Connection using the Termius

Another connection option is to use the Termius client. It is a handy ssh connection manager client with an additional SFTP client function. Termius is available directly from the App Store and can be synchronized with your iCloud.

1. Create the first connection. In the Hosts section, click New Host. Fill in the Address (address or domain name of your server), Username and Password fields. Change the Port field if the standard SSH port 22 has been changed on the server. In the Label field you can set a recognizable server name.

2.  After filling in all the fields, go to the main screen of the Hosts tab and double-click on the shortcut of the server you need. When connecting for the first time, the application will show a warning about an unknown host - allow it and connect:

In addition to the standard password access, SSH key connection is also available in this application. Edit the saved server and click Set a Key

Next, you can copy and paste the contents of the key, or you can import the key from a file. After that click Save:

Built-in SFTP client

On the SFTP tab an option to connect to servers using SFTP protocol is available. The utility provides a two-window mode of a classic file manager, where the left tab opens the file system of one server and the right tab opens the file system of another. You can copy and move files between servers.

You can connect to the server using the Select host buttons on both tabs. Your saved hosts to which you have configured an ssh connection are available for selection. It is also possible to open local storage (Local button) of files on one of the tabs and exchange files between your Mac and the server.

An example of a parallel connection to two servers in a collection:

Conclusion

Connecting to a server via SSH on a MacOS device is easy and secure. By following the steps outlined in this guide, you can establish a secure connection to a remote server and manage your tasks remotely.