How to Use SSH to Access Computer on Remote Network
SSH, or Secure Shell, is a protocol that allows you to securely access and control a computer by hostname or IP address.
To connect to a computer on the remote network from any operation using the SSH protocol, we need to understand the main components of the SSH command.
Format: ssh username@hostname_or_IP_address -port_number
Three keys to SSH command:
- Username: The account you want to use SSH to access the server.
- Hostname or IP Address: e.g. www.xxxxxx.com or 255.255.255.255
- Port Number: By default, the SSH port number is 22. If you have the default port number, you do not have to specify the port number when entering SSH commands. If you have changed it to another port number, you must specify the specific port number.
Next, we will learn how to connect to a remote computer using SSH on Windows, macOS and Linux respectively:
Operating System | Method |
On Windows | Invoke SSH: Install the virtual terminal program such as PuTTY (Learn More) |
On Linux | Built-in SSH: Using the SSH command (Learn More) |
On macOS | Built-in SSH: Using the SSH command (Learn More) |
Connect to Remote Computer Using SSH on Windows
The best way to connect to a computer on the remote network using SSH on Windows is to use a third-party SSH client, such as PuTTY or SecureCRT. Please refer to the following steps:
Step 1: Download and install PuTTY on Windows.
Step 2: Launch PuTTY and enter the hostname or IP address of the remote computer in the configuration. Click "Open."
Step 3: If this is the first time you are connecting to the system, a pop-up window will appear to confirm your connection, please click "Yes."
Step 4: Next, enter the username and password when prompted. You can now control the remote computer.
Step 5: After completing the SSH remote connection, type "exit" and press Enter or directly close the window to end the connection.
The Most Convenient Remote Connection Tool for Windows
The fastest and most secure way to connect to a remote computer without additional configuration: try AirDroid Remote Support!
Connect to Remote Computer Using SSH on Linux
Using SSH in Linux is very simple because SSH is built into the command prompt and you can easily access a remote computer by simply typing the SSH command. Please refer to the following steps:
Step 1: Press Ctrl + Alt + T or go to the Applications menu and search for "terminal" on a Linux computer to find and open the application.
Step 2: Log on to the remote computer by entering the SSH command (username, host name/IP address, port number) in the Terminal.
Step 3: If this is the first time you are connecting to the system, you will receive a warning that the SSH connection key is unknown, type "Yes" to confirm the connection.
Step 4: Next, enter the password when prompted. You can now control the remote computer.
Step 5: After completing the SSH remote connection, press Ctrl + D or type "logout" to end the connection.
To find SSH related configuration files:
$ file /etc/ssh/sshd_config
/etc/ssh/sshd_config: ASCII text
To install and enable SSH:
[server]$ sudo dnf install openssh-server
[server]$ systemctl enable --now sshd
Connect to Remote Computer Using SSH on macOS
SSH is also built into the Mac, but it is disabled by default for receiving external connections. If you want to access a computer on the remote network via SSH, you need to enable "Remote Login" first:
Go to "System Preferences" > "Sharing" and check "Remote Login."
You can also specify whether to allow all users or only some users to login remotely.
Next, you can use the SSH command to connect to another computer remotely. Please refer to the following steps:
Step 1: Open the "/Applications/Utilities" folder in "Finder" and double-click "Terminal."
Step 2: Log on to the remote computer by entering the SSH command (username, host name/IP address, port number) in the Terminal. (as on Linux)
Step 3: If this is the first time you are connecting to the system, you will receive a warning that the SSH connection key is unknown, type "Yes" to confirm the connection.
Step 4: Next, enter the password when prompted. You can now control the remote computer.
Step 5: After completing the SSH remote connection, press Ctrl + D or type "exit" to end the connection.
Conclusion
This article has delivered a wide guide on utilizing SSH across different operating systems, covering Windows, Linux, and macOS environments. In conclusion, SSH (Secure Shell) stands out as a robust protocol for securely accessing and managing computers over a network.
Leave a Reply.