How to Access Linux Server from MacOS
SSH, also known as Secure Shell, is an encryption protocol that can be used to connect the command line of the remote device. macOS comes with an integrated SSH client, dubbed Terminal, which lets you quickly and effortlessly connect to any server via its IP address.
In this guide, we’ll talk about how to connect to Linux VPS server on Mac terminal, as well as PuTTY for Mac. But first, let’s get down to the basics.
How Does SSH Work?
SSH uses TCP port 22 as default, but this can be changed to a different port. The SSH process employs the symmetric encryption method, asymmetric encryption, and hashing securely to connect the server to its client.
When you first join the server, you’ll be asked to verify the public key for the server. In subsequent connections, the client will use the verified public key to confirm that you’re still connected to the same server reference to the known_hosts database.
Both the client and server agree on the session key that can be used to decrypt and decrypt the information sent through an SSH connection.
The server then authenticates the client by using the SSH key (if it is available and utilized).
How to SSH into a Server Using Terminal Mac
Step 1: Start the Terminal
Open in Finder the Applications directory. Then, double-click on the Utility folder.
Double-click to open this icon to launch the terminal application. It is possible to drag the icon onto your dock to make it easy to access.
Step 2: Type the normal SSH command.
SSH to Linux from Mac:
Replace the user and IP address with your username as well as the IP of the Linux server you are trying to connect to. Press return to run the command.
The server will connect to the server using SSH using the username of the username and using the standard SSH port 22.
SSH to Linux from Mac Commands
Here are some typical SSH command examples that are able to be utilized in The Terminal application.
Making a List of SSH Commands
By using the following command, you will get a list of commands available to use.
Set Port in SSH
When trying to connect to a Linux server on Mac Terminal, the server may use a nonstandard port; it is necessary to make this clear during the connection procedure:
Connecting using an SSH Key
If you want to connect with the SSH keys instead of using a password, make use of the following command:
Connect using the Verbose Mode
The verbose mode can be helpful for diagnosing SSH connectivity issues because it displays all stages of the connection:
The end of the SSH Connection
Enter “exit” to close the connection. You can also use PuTTY to connect to Linux server on macOS.
What Is PuTTY?
PuTTY is an SSH terminal, and the client is rolled into one. It offers a GUI that you can use to connect to and even configure the servers you are familiar with.
PuTTY isn’t a native Mac program, which, as such, it’s not very easy to work with. It does not even support paste, which could make certain operations (like making use of passwords) difficult. It aims to emulate the appearance and feel of the first Windows application rather than integrate well with macOS.
How to Install PuTTY on MacOS
As mentioned, you can use PuTTY for Mac in order to connect to Linux server. The best method of installing PuTTY to macOS is through MacPorts. Although it is possible to install PuTTY by using Homebrew, it does not come with the GUI element of PuTTY.
- Start The Terminal app on your Mac.
- Use this command:
Then, you are able to download three applications into the /opt/local/bin directory: putty, puttygen, and puttytel.
The folder /opt/local/bin is in the directory of your PATH, and you will be able to access PuTTY on the command line by typing: putty
Using a Symlink as well as a Mac alias, you could create a shortcut for putty and then launch it. For example, you can open it from your desktop:
Alternatively, you could make use of Automator to create an Application that will function as any other, provided you save it to the Applications folder.
How to Use PuTTY for Mac
Begin by using PuTTY via the command line or use other methods mentioned above to launch the program.
When PuTTY begins, you’ll get prompted configuration dialogue.
There could be a slight delay between opening the application and getting this message. This is likely because PuTTY needs to begin the XQuartz backend and is not a reason to be concerned.
In order to access the Linux server from Mac, enter the server’s Hostname and IP Address into the field.
PuTTY has a range of connection types which include SSH, Telnet and Rlogin. They are all different protocols that have different advantages; however, most times, you’ll prefer using SSH as the default. PuTTY will assign the port automatically based on the type of connection. It is possible to overwrite it in case the server is using an non standard port.
Once you’ve finished setting it up after you’ve finished, select “Open” for connection to the server you’ve chosen.
The most notable feature of PuTTY is its configuration interface. If you frequently connect to multiple servers, saved sessions are a must. They permit you to save every configuration detail to a specific connection, such as the server, the type of connection as well as the behavior and appearance of the device, and much more.
Once you’ve made the configuration adjustments you’d like to make, choose one of the sessions in your saved sessions option, and then type an entirely new name for it in the text box with a single line.
Hit on the Save button.
You can save a session using the option of selecting it from the list and then clicking to load. And that’s how to access Linux from Mac and specifically PuTTY.
Conclusion
In this guide, we discussed how to connect to Linux Server on Mac with IP address using the terminal as well as PuTTY for Mac. Being able to connect to a server with the Terminal interface is one of the awesome features Macs come with. However, it may be confusing for beginners to macOS. Thus, most people tend to use an interface they are familiar with, like PuTTY.