In addition to connecting to computers remotely running SSH servers, SSH clients can also be used for SSH tunneling, SCP file transfers, and much more.
In a previous article, Mytour introduced the concept of Windowserver, how it works on Mac machines, and whether it can be turned off. In this article, we will guide you on how to connect to an SSH server on Windows, macOS, and Linux.
Connecting to SSH Server on Windows, macOS, and Linux
Connecting to SSH Server on Windows
Windows lacks built-in support for SSH commands. Microsoft gained notoriety for officially integrating SSH client into PowerShell in 2015; however, users aren't widely aware of integrating SSH Client into PowerShell. Therefore, the most common solution for connecting Windows to SSH servers is using open-source code, a third-party application called PuTTY.
Download PuTTY to your machine, install it, and then open the application to get started. Alternatively, you can download an installer package that includes PuTTY and related utilities. The putty.exe file can also function as a portable application.
Download PuTTY to your computer and install it here: Download PuTTY
Enter the host name or IP address of the SSH server in the Host name (or IP address) field. Ensure the port number in the Port field matches the port required by the SSH server. By default, SSH servers use port 22, but servers are often configured to use a different port. Click Open to establish the connection.
On the first connection to the server (host), you will encounter security warnings. These warnings inform you that you haven't connected to this server before. Click OK to proceed.
If you still see these warnings in the future after connecting to the server, it's because the encryption key fingerprint of the server has changed. An admin has altered it, or someone is trying to block your access and deceive you into connecting to a malicious SSH server, making you believe it's the legitimate SSH server. Therefore, you must exercise extreme caution.
You will be prompted to enter your username and password for your account on the SSH server. Once completed, you will be connected. Simply close the window to terminate the SSH connection.
Furthermore, with PuTTY, you can achieve much more. For instance, if you want to use a Private key file for authentication with the SSH server, you'll find this option under Connection =>SSH =>Auth in the PuTTY Configuration window when you launch the application. Readers can refer to the PuTTY manual for additional information.
Link to PuTTY manual: https://the.earth.li/~sgtatham/putty/0.69/htmldoc/
Connecting to SSH server on macOS and Linux
Operating systems based on UNIX, such as macOS and Linux, include an integrated SSH command that operates quite similarly. Surprisingly, you can use this command on Windows 10 through the Bash environment.
To connect to an SSH server from one of these operating systems, first, open a Terminal window. On Mac, you'll find the application in Finder =>Applications =>Utilities =>Terminal. On Linux computers, locate the Terminal shortcut in the application menu. On Windows, install and open the Bash shell.
To connect to an SSH server, enter the command below into the Terminal window, replacing the username with your username on the SSH server and ssh.server.com with the server's name or IP address:
This command will connect to the SSH server on port 22, which is the default port. To specify a different port, add -p to the end of the command followed by the port number you want to connect to, for example:
ssh [email protected] -p 2222
On the first connection, you'll receive a server confirmation request. It's normal if this is indeed your first time connecting to the server; enter Yes to proceed.
If you've connected to the server before and receive this message, it indicates the admin has changed the fingerprint, or you're being tricked into connecting to a fake server. Exercise caution in such situations.
You will be prompted to enter the user account password required on the SSH server before proceeding. Once the password is entered, you will be connected. Close the window or type 'exit' in the Terminal window and press Enter to disconnect from SSH.
Additionally, if desired, you can find more information about using SSH commands on the SSH manual page. Access the page by entering the command: man ssh in the Terminal window or by visiting the page on a web browser.
Here, Mytour has introduced you to various ways of connecting to SSH servers on Windows, macOS, and Linux. We hope this article provides you with valuable information.
