# USING SSH 

Firstly, what does SSH mean? Well, it stands for Secure Shell, and it allows users to securely connect to and manage other systems remotely. By using SSH, you can execute commands like *cd, mkdir*, *etc* without physically needing to be on a system.

## Lab Environment

*   **Virtual Machine -** [VMware Workstation Pro](https://www.techspot.com/downloads/189-vmware-workstation-for-windows.html)
    
*   **Remote Access (SSH) -** [PuTTY](https://apps.microsoft.com/detail/xpfnzksklbp7rj?hl=en-US&gl=US)
    
*   **Operating System (ISO Image)** - [Red Hat Enterprise Linux 10.2 (DVD ISO)](https://developers.redhat.com/products/rhel/download#downloadsbyrelease)
    

*#PuTTY is a simpler GUI-based SSH client that makes it easier to connect to a system remotely; however, I will also show the conventional way to do so, straight from the command line.*

## How To SSH

Using SSH is fairly straightforward; you just need the server name and hostname or IP address of the system you want to log into. However, let's check to see if SSH is installed on your system.

Use the command *rpm -q openssh-server* to see if SSH is installed, as well as which version is installed; then use *systemctl status sshd* to see if SSH is running properly.

*   rpm - Manages packages on Red Hat-based Linux distros.
    
*   \-q - Stands for Query and retrieves information about installed packages.
    
*   systemctl - Used to control the system and service manager.
    
*   status - Is an argument/subcommand that checks the status of a package to see if it's enabled or not.
    

![](https://cdn.hashnode.com/uploads/covers/6aab15fc963009129466d4b7/c6d27e5b-f2ad-42db-a22a-8edd742be2f0.png align="center")

There are other types of SSH commands too, like *openssh-clients* and *openssh; here's* what you should know about them:

*openssh-clients - Provides tools like the SSH command that allow the MAIN SERVER to SSH to other systems*

*openssh-server - Provides tools that allow OTHER* Firstly, what does SSH mean? Well, it stands for Secure Shell, and it allows users to securely connect to and manage other systems remotely. By using SSH, you can execute commands like *cd, mkdir*, *etc* without physically needing to be on a system.

## Lab Environment

*   **Virtual Machine -** [VMware Workstation Pro](https://www.techspot.com/downloads/189-vmware-workstation-for-windows.html)
    
*   **Remote Access (SSH) -** [PuTTY](https://apps.microsoft.com/detail/xpfnzksklbp7rj?hl=en-US&gl=US)
    
*   **Operating System (ISO Image)** - [Red Hat Enterprise Linux 10.2 (DVD ISO)](https://developers.redhat.com/products/rhel/download#downloadsbyrelease)
    

*#PuTTY is a simpler GUI-based SSH client that makes it easier to connect to a system remotely; however, I will also show the conventional way to do so, straight from the command line.*

## How To SSH

Using SSH is fairly straightforward; you need the username on the destination system and its hostname or IP address. of the system you want to log into. However, let's check to see if SSH is installed on your system.

Use the command *rpm -q openssh-server* to see if SSH is installed, as well as which version is installed; then use *systemctl status sshd* to see if SSH is running properly.

*   rpm - Manages packages on Red Hat-based Linux distros.
    
*   \-q - Stands for Query, and retrieves information about installed packages.
    
*   systemctl - Used to control the system and service manager.
    
*   status - Is an argument/subcommand that checks the status of a package to see if it's running or not.
    

![](https://cdn.hashnode.com/uploads/covers/6aab15fc963009129466d4b7/c6d27e5b-f2ad-42db-a22a-8edd742be2f0.png align="center")

There are different types of SSH packages too, like *openssh-client* and *openssh; here's* what you should know about them:

*openssh-clients - Provides tools such as the SSH command that allow the client system to connect to other systems.*

*openssh-server - Provides the SSHD service that allows servers to connect to your system.*

*openssh - Supports both server and client by providing them with the utilities that they need to SSH to your server.*

## Step-by-Step Guide

Now that you've checked if SSH is installed, you want to find the username of the account you want to log in to and the hostname and/or destination hostname of the system that you want to remotely access.

To find the username of the person that you want to log in as, use the command *whoami*, which will show the name of the currently logged-in account.

![](https://cdn.hashnode.com/uploads/covers/6aab15fc963009129466d4b7/554a8781-e311-4af0-b8b4-0d40c2bf86e9.png align="left")

The hostname is always after the "*@"*:

![](https://cdn.hashnode.com/uploads/covers/6aab15fc963009129466d4b7/7cabace0-34c8-489e-a54b-6e6d742c8df3.png align="left")

You can also use the command *hostname* to find it

![](https://cdn.hashnode.com/uploads/covers/6aab15fc963009129466d4b7/fb195a0d-bb9c-4172-bd94-7464486ecffd.png align="left")

The hostname in this instance is *"HostServer".* Alternatively, you can use the host's IP address with the command ip a, which shows all of your system's IPs.

![](https://cdn.hashnode.com/uploads/covers/6aab15fc963009129466d4b7/fc377053-1151-4a48-bbed-411b09f19acd.png align="center")

In this case, I am going to use the IP "10.0.0.136"

Now, I am going to connect to the "HostServer" using SSH.

![](https://cdn.hashnode.com/uploads/covers/6aab15fc963009129466d4b7/928cecdd-fed9-4e26-9859-ae45bed2ef59.png align="center")

# Conclusion

Now we know the purpose of the SSH command, how to connect/download the SSH package, and how to connect to other systems using SSH.
