What is SSH?
SSH stands for Secure Shell. It is a tool for communicating with a server remotely. The Secure Shell (SSH) protocol is a method to securely send commands to a computer over an unsecured network like the Internet. You can access the server that allows you to make the required modifications.
SSH deploys cryptography to authenticate and encrypt connections between devices. It makes use of text commands that execute all the actions. It is similar to a command-line interpreter like the Command Prompt available in most Windows distributions.
Functions of SSH
SSH can perform many functions. Here are a few of them:
- Manage, control, and modify systems and applications remotely.
- Run commands to manage files, folders, and databases.
- Create secure tunnels for other application protocols and run sessions remotely.
Basic SSH Commands
SSH has several commands that help you access, manage, and make necessary changes to the server. Here are the 25 most important commands to help you execute actions:
- ls - Shows directory contents (lists the names of files).
- man - Stands for manual. This command is always used in addition to another command, like
cd
. It displays all the additional options available with that command with a complete description. - cd - Changes the directory.
- chown - Changes user and group ownership.
- chmod - Changes permissions (read, write, and execute) for the owner, group, and other users accessing that file/directory.
- mkdir - Creates a new folder or directory.
- touch - Creates a new file.
- cat - Shows the contents of a file.
- rm - Removes a file easily.
- pwd - Shows the full path of the current directory.
- top - Gives a periodic update of running Linux tasks.
- ps - Shows a snapshot of all currently processing tasks.
- du - Gets file size.
- wget - Downloads files from the internet.
- tar - Creates and unpacks compressed archives.
- df -h - Gives current overall disk usage in gigabytes.
- du -hs - Calculates the total directory size in a human-readable format.
- clear - Clears the terminal screen.
- vi/nano - Text editors;
nano
is easier for beginners, whilevi
is for experienced users. - history - Shows the last 50 used commands.
- cp - Copies a file/folder.
- mv - Moves a file/folder.
- grep - Searches for a specific phrase in a file/line.
- find/locate - Searches files and directories in an indexed database.
- locate -u - Periodically updates the database files for a faster and more comprehensive file search.
In a Nutshell
SSH is a useful method for making a secure connection between the server and the client. With its end-to-end encryption, you can access your server remotely and securely. The above commands are crucial to learning as they help you manage your server easily.