SSH (short for Secure Shell) is one of the network protocols that has been around since the mid 90s. It is the successor to previous, more insecure protocols that allowed you to issue commands and administer Linux systems. The issue with these insecure protocols is that there were a number of vulnerabilities associated with them, which included poor/non-existent authentication measures and sending data over the network in cleartext. SSH was developed in order to address these concerns and more, and is now the de facto standard for logging into Linux systems. From a beginner security professional perspective, however, all you need to know is that it is used to log into Linux systems and can be configured in a number of ways to provide a secure means of authentication into Linux systems. Authentication is typically done with either a username/password combo or a username/key combo, the latter being the more secure method. We’ll start with the username/key combo for demonstration purposes:
Establishing an SSH connection to 3.236.254.169
From the screenshot, the first line is me running the SSH command from a command line window (cmd.exe) on my Windows system, which is one of the default applications available on Windows 10 systems. The “kali@3.236.254.169” says tells the SSH program that you would like to authenticate as the “kali” user on the system with the IP address of 3.236.254.169, which happens to be a Linux system. The ‘-i “Downloads\nvirginia-keypair.pem”’ is the “key” that is being used for the “kali” user to authenticate to the system with the IP address of 3.236.254.169. You can think of a key as a password for the user that you are authenticating as. Due to the flaws of passwords such as password reuse, password leaks, as well as easily guessable passwords, using keys for authentication is a much better practice from a security standpoint. After pressing “Return” or “Enter” on the keyboard, you will be presented with a prompt letting you know that you have successfully logged into the system. By default, you will be placed into your specified home directory on the system, which in this case is /home/kali.
Now that you’re logged in, you can start running some default commands provided by Linux in this SSH session. Because this is an article for aspiring Linux professionals, try the following ones:
• pwd (which prints the current directory that you’re in)
• ls -a (which will list all the files in your current directory, including the hidden ones)
Executing basic Linux commands
Keep in mind that all the commands that you run will be executed as the user you logged in as. Consequently, there will be certain commands that you will be unable to run or parts of the Linux system that you will not have access to. This is by design, as you don’t want your users inadvertently messing up the system! However, there is a user known as the “root” user that has access to all resources on a Linux system and can do anything it pleases. This “root” access is given to only those who need it and should only be used when absolutely needed.
Now that we had a simple overview of SSH, you may notice that you can do all kinds of things to the system over SSH. Because of this fact, the Linux security professionals will want to configure the SSH of a Linux system so that only the users that need access to the Linux system have access to it. This viewpoint adopts the concept of least privilege, which can be interpreted in this case as “only allow users what they need, and nothing else”. All kinds of malicious activity can be performed by an attacker with SSH access to a Linux system, and you will want to lock it down as much as possible.
SSH is a large topic in and of itself and can easily span multiple guides and articles. This is only mean to introduce security professionals to SSH, and what can potentially be performed with it.