Linux Commands Net

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

Linux/Unix SSH, Ping, FTP, Telnet

Communication Commands
ssh stands for “Secure Shell”. It is a protocol used to securely connect to a remote
server/system. ssh is secure in the sense that it transfers the data in encrypted form
between the host and the client. It transfers inputs from the client to the host and relays
back the output. ssh runs at TCP/IP port 22.

Compare to Telnet, SSH is secure wherein the client /server connection is


authenticated using a digital certificate and passwords are encrypted. Hence it’s widely
used by system administrators to control remote Linux servers.
Syntax:
ssh user_name@host(IP/Domain_name)
ssh command consists of 3 different parts:
 ssh command instructs the system to establish an encrypted secure connection with
the host machine.
 user_name represents the account that is being accessed on the host.
 host refers to the machine which can be a computer or a router that is being
accessed. It can be an IP address (e.g. 192.168.1.24) or domain name(e.g.
www.domainname.com).

SSH is significantly more secure than the other protocols such as telnet because of the
encryption of the data. There are three major encryption techniques used by SSH:
 Symmetrical encryption: This encryption works on the principle of the generation of
a single key for encrypting as well as decrypting the data. The secret key generated is
distributed among the clients and the hosts for a secure connection. Symmetrical
encryption is the most basic encryption and performs best when data is encrypted and
decrypted on a single machine.
 Asymmetrical encryption: This encryption is more secure because it generates two
different keys: Public and Private key. A public key is distributed to different host
machines while the private key is kept securely on the client machine. A secure
connection is established using this public-private key pair.
 Hashing: One-way hashing is an authentication technique which ensures that the
received data is unaltered and comes from a genuine sender. A hash function is used
to generate a hash code from the data. It is impossible to regenerate the data from the
hash value. The hash value is calculated at the sender as well as the receiver’s end. If
the hash values match, the data is authentic.
Ping
This utility is commonly used to check whether your connection to the server is
healthy or not.This command is also used in –

 Analyzing network and host connections


 Tracking network performance and managing it
 Testing hardware and software issues
 Command Syntax:-
ping hostname="" or=""
Example :
ping 172.16.170.1

ping google.com

Here, A system has sent 64 bytes data packets to the IP Address (172.16.170.1) or the
Hostname(www.google.com). If even one of data packets does not return or is lost, it
would suggest an error in the connection. Usually, internet connectivity is checked
using this method.

You may Press Ctrl + c to exit from the ping loop.

FTP
FTP is file transfer protocol. It’s the most preferred protocol for data
transfer amongst computers.

You can use FTP to –

 Logging in and establishing a connection with a remote host


 Upload and download files
 Navigating through directories
 Browsing contents of the directories

How to Use ftp Command in Linux


The ftp command connects a computer system to a remote server using the FTP protocol. Once
connected, it also lets users transfer files between the local machine and the remote system, and
manage files and directories on the remote system.
Establish an FTP Connection
To establish an FTP connection to a remote system, use the ftp command with the remote
system's IP address:

ftp [IP]

For instance, connecting to a remote server with the IP address 192.168.100.9:

ftp 192.168.100.9

Log into the FTP Server


Once you initiate a connection to a remote system using the ftp command, the FTP interface
requires you to enter a username and password to log in:

Entering the required credentials logs you in and starts the FTP interface. In this example, we are
logging in as the phoenixnap user:

Once a connection is established, and you are logged in, you may 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 Logout
Let us run some of the important commands.

Telnet
Telnet helps to –

 connect to a remote Linux computer


 run programs remotely and conduct administration
 This utility is similar to the Remote Desktop feature found in Windows Machine.

The syntax for this utility is:


telnet hostname="" or=""
Example:
telnet localhost

For demonstration purpose, we will connect to your computer (localhost). The utility will
ask your username and password.

Once authenticated, you can execute commands just like you have done so far, using
the Terminal. The only difference is, if you are connected to a remote host, the
commands will be executed on the remote machine, and not your local machine.

You may exit the telnet connection by entering the command ‘logout’

You might also like