Fundamental SSH Commands You Should Be Familiar With!

ZYNOO
4 min readJul 5, 2021

--

SSH, secure socket shell, or secure shell is a network protocol. It provides a secure way of accessing a computer over an untrusted or unsecured network. It provides public-key authentication, strong password authentication, and communication between 2 computers.

Besides providing strong encryption, network administrators use SSH for managing applications and systems remotely. This enables them to sign in to the other computers, execute commands, and forward files.

How SSH works?

The secure shell was designed for replacing Rlogin, Telnet, and other insecure terminal emulation. Furthermore, SSH is also used for replacing file transfer programs. For example — remote copy (RCP) and file transfer protocol (FTP).

This client-server-based protocol enables a client to connect to the server. However, for issuing SSH commands, firstly you have to complete the authentication process.

The secure shell consists of 3 layers. Namely — transport, authentication, and connection layer. Here is a detailed description of all three layers.

Uses of secure shell

SSH connections are used for securing various types of communication between a remote host and a local machine. It includes — remote execution of commands, secured remote access to the resources, delivery of software patches, and various other administrative management and administrative tasks.

The uses of SSH are not limited to creating a trusted channel between remote and local computers. It is also used for server hardware, managing routers, and file transfer applications.

SSH keys are employed for automating access to the servers. They are used in configuration management, scripts, and backup systems. A user can use SSH with an ordinary password and ID. Some important uses of SSH are — it ensures remote connections, manages a trusted file transfer protocol, tunneling for data transfer, and network management.

Capabilities of SSH

SSH is used in various software and scripts for enabling systems and programs to securely and remotely access data and other information. It includes the following functions -

History of SSH

Its first version was designed by Tatu Ylonen in 1995. During that time, he was a researcher and later started SSH communication security. Over time, various issues have been found in SSH 1, and the version is considered unsafe.

SSH-2 was adopted in 2006 by the IETF (internet engineering task force) as a standards-track specification. It uses a stronger integrity check and Diffie-Hellman key exchange for improving security. Various encryption methods such as — Blowfish and Advanced Encryption Standard, can be used by the SSH servers and clients.

The basic SSH commands and their description

cat print the content to the screen
cd- change directory
cd.. go up
cp copy a file
du show disk usage
file* print a list of all the directories/files in the directory.
kill terminate a system process
last show the names and timings of who logged in
last-20 displays the last 20 logins
In create a link between directories and files
netstat shows current network connections
pico friendly file editor
ps aux shows system processes
rm delete a fil
rm-rf tmp/ deletes the directory and all files and subdirectories in it

Is it possible to put SSH commands together?

Yes, it is possible. A majority of times you wish to use different commands on a specific line. Here, are some examples for achieving your goal.

| character is known as a pipe. It takes a date from any program and pipes it to the other. Similarly, > means the creation of a new file, >> refers to append data to a file and < means to send input into a command.

After logging in to your VPS server by putty, numerous SSH Commands are available for monitoring and managing its resources. Have a glance at the 4 of them.

Touch command will enable you to create a new file. The timestamp of the file will be updated by the command if it already exists.

For making required changes to the file, use the nano command for launching a text editor. For removing one or multiple files on the server use the rm command.

Create a directory with the mkdir command.

mkdir assignment create a directory known as the assignment

mkdir-p assignment create a directory name assignment even if it already exists.

Use the cd command for navigating the filesystem of your server.

cd/path/to/your/directory/ The current directory can be changed to the nominated path.

cd~ navigate to the home directory

cd.. navigate to the parent of the current directory

Final thoughts

SSH stands as the remote administration protocol for modifying and controlling your remote servers. For secure transferring of information, SSH uses 3 types of encryptions — symmetrical, asymmetrical, and hashing.

A majority of people think that SSH commands are complex. However, they are easy to use and understand. Above we discussed its uses and importance in detail to understand the security aspects of SSH.

As you know, learning SSH commands is important for managing VPS. So, we have also discussed the description of 15 basic commands that are important for a webmaster.

Originally published at https://zynoo.com on July 5, 2021.

--

--