Linux/Unix SSH, Ping, FTP, Telnet Communication Commands
โก Smart Summary
Linux communication commands such as SSH, Ping, FTP, and Telnet let you connect to remote systems, test network reachability, transfer files, and administer servers directly from the terminal on any Linux or Unix machine.

While working on a Linux operating system, you may need to communicate with other devices. For this, there are some basic utilities that you can make use of. These utilities help you communicate with networks, other Linux systems, and remote users. The illustration below shows how these tools link your machine to networks and remote hosts.
So, let us learn them one by one: SSH, Ping, FTP, and Telnet.
SSH
SSH, which stands for Secure Shell, is used to connect to a remote computer securely. Compared to Telnet, SSH is secure because the client/server connection is authenticated using a digital certificate and passwords are encrypted. Hence, it is widely used by system administrators to control remote Linux servers.
The syntax to log into a remote Linux machine using SSH is:
ssh username@ip-address or hostname
The screenshot below shows a terminal connecting to a remote machine with the ssh command.
Once you are logged in, you can execute any commands that you would run in your own terminal. For example, use the ls command to list the files in the current directory:
ls
The output of the ls command appears as shown below.
Similarly, run the pwd command to print the current working directory:
pwd
The pwd command returns the path of the working directory, as shown below.
Ping
The ping utility is commonly used to check whether your connection to a server is healthy or not. This command is also used for:
- Analyzing network and host connections
- Tracking network performance and managing it
- Testing hardware and software issues
Command syntax:
ping hostname or IP-address
For example, ping a device by its IP address:
ping 172.16.170.1
The ping command sends packets to the IP address and reports the replies, as shown below.
You can also ping a host by its domain name:
ping google.com
The output below shows ping reaching a host through its hostname.
Here, a system sends 64-byte data packets to the IP address (172.16.170.1) or the hostname (www.google.com). If even one of the data packets does not return or is lost, it suggests an error in the connection. Internet connectivity is usually checked using this method. You may press Ctrl + c to exit the ping loop.
FTP
FTP is the File Transfer Protocol. It is the most preferred protocol for transferring data among computers. The illustration below represents an FTP file transfer between a local and a remote computer.
You can use FTP to:
- Log in and establish a connection with a remote host
- Upload and download files
- Navigate through directories
- Browse the contents of directories
The syntax to establish an FTP connection to a remote host is:
ftp hostname or IP-address
Once you enter this command, it asks you for authentication using a username and password, as shown below.
Once a connection is established and you are logged in, you can use the following commands to perform different actions.
| Command | Function |
|---|---|
| dir | Display files in the current directory of a remote computer |
| cd “dirname” | Change directory to “dirname” on a remote computer |
| put file | Upload ‘file’ from local to remote computer |
| get file | Download ‘file’ from remote to local computer |
| quit | Log out |
The screenshot below shows some of these important FTP commands being run in a session.
Telnet
Telnet helps you to:
- Connect to a remote Linux computer
- Run programs remotely and conduct administration
This utility is similar to the Remote Desktop feature found on Windows machines. The illustration below shows a Telnet connection to a remote Linux computer.
The syntax for this utility is:
telnet hostname or IP-address
For example, connect to your own computer (localhost):
telnet localhost
For demonstration purposes, we will connect to your computer (localhost). The utility asks for your username and password, as shown below.
Once authenticated, you can execute commands just as you have done so far using the terminal. The only difference is that, if you are connected to a remote host, the commands are executed on the remote machine and not on your local machine. You may exit the Telnet connection by entering the command ‘logout’.
Why SSH Replaced Telnet
Telnet, one of the oldest remote-access tools, sends everything you type โ including your username and password โ across the network as plain text on port 23. Anyone capturing that traffic can read the credentials, which makes Telnet unsafe on the public internet. SSH was designed to fix exactly this weakness.
SSH improves on Telnet in several important ways:
- Encryption: SSH encrypts the entire session over port 22, so passwords and data cannot be read in transit.
- Authentication: SSH verifies the server with a digital key and supports key-based logins that are stronger than passwords.
- Integrity: SSH detects if the data stream is tampered with during transfer.
Because of these protections, system administrators now use SSH to manage remote Linux servers, and Telnet survives mainly for quick testing or on trusted internal networks.
SSH, Ping, FTP, and Telnet Compared
Each of these utilities solves a different communication problem, from testing a link to moving files and running remote sessions. The table below summarizes how they compare so you can pick the right tool.
| Utility | Purpose | Protocol | Default Port | Encrypted |
|---|---|---|---|---|
| SSH | Secure remote login and administration | TCP (SSH) | 22 | Yes |
| Ping | Test whether a host is reachable and measure latency | ICMP | None (portless) | Not applicable |
| FTP | Transfer files between hosts | TCP (FTP) | 21 (20 for data) | No (plain FTP) |
| Telnet | Remote terminal access | TCP (Telnet) | 23 | No |
For anything exposed to the internet, choose the encrypted options: SSH for remote sessions and SFTP or SCP (both of which run over SSH) for file transfers.

.png)





.png)


.png)
