What is SSH?
SSH (Secure Shell) is a cryptographic network protocol
used to securely access and manage remote systems over
an unsecured network. It provides encrypted
communication between a client and server, enabling
tasks like remote login, file transfer, and command
execution. SSH is widely used by system administrators
for secure management of Linux servers and is an
essential tool in modern DevOps and enterprise
environments.
-Shivaji Bedre
Step 1: Check Server OS Version
Before configuring the SSH server, ensure that your
system is running the expected OS version.
Command:
cat /etc/os-release
The output confirms the system is: ..
OS: Red Hat Enterprise Linux 9.0
Platform ID: platform:el9
Pretty Name: Red Hat Enterprise Linux 9.0 (Plow)
Also check in client side
-Shivaji Bedre
Step 2: Check Current Firewall Configuration
Before enabling SSH, check the active firewall zone and its
rules.
Command:
firewall-cmd --list-all
Output Highlights:
Active Zone: public
Interfaces: enp0s3
Services Allowed: cockpit, dhcpv6-client
SSH is not listed, so it needs to be added.
-Shivaji Bedre
Step 3: Allow SSH Through Firewall
After verifying that SSH was not allowed in Step 2, we now
add it permanently to the firewall and reload the settings.
Commands Used:
firewall-cmd --permanent --add-service=ssh
firewall-cmd --reload
firewall-cmd --list-all
Output Highlights:
success indicates the SSH service was added and
firewall reloaded.
SSH is now listed under services:
services: cockpit dhcpv6-client ssh
This ensures that the RHEL 9 server will accept incoming
SSH connections from remote systems like your Ubuntu
client.
-Shivaji Bedre
Step 4: Review or Edit SSH Server Configuration
To ensure the SSH server is configured properly (for
example, to allow root login, change port, or enable
password authentication), edit the SSH daemon config file.
Command:
vi /etc/ssh/sshd_config
Common Settings to Check or Modify:
Port 22 – Default SSH port
PermitRootLogin yes – Allow root login (optional &
risky)
PasswordAuthentication yes – Allow password-based
logins
-Shivaji Bedre
After making changes:
systemctl restart sshd
This applies the new configuration settings.
-Shivaji Bedre
Step 5: Check IP Address of the RHEL 9 Server
Before initiating an SSH connection from the client
(Ubuntu), identify the IP address of the server.
Command :
ip a
Output Highlights:
Interface: enp0s3
Server IP Address: 192.168.203.2**
This is the IP that the Ubuntu system will use to connect
via SSH.
-Shivaji Bedre
Step 6: Connect to SSH Server from Ubuntu Client
Now that we know the RHEL 9 serverÕs IP address
(192.168.203.209), letÕs connect to it from the Ubuntu
client system.
Direct SSH Connection
Command:
ssh username@192.168.203.209
Create a directory and file in client side
Check that directory and file show in server side
Successfully configuring and verified SSH
-Shivaji Bedre
Set Up Passwordless SSH Login Using ssh-keygen
To improve security and convenience, you can connect to the
RHEL 9 SSH server from the Ubuntu client without
entering a password every time. This is done using SSH
key-based authentication.
1. Generate SSH Key Pair on Ubuntu Client
ssh-keygen
-Shivaji Bedre
2. Copy Public Key to the RHEL 9 Server
Command:
ssh-copy-id username@192.168.203.209
Enter the user's password once — after this, passwordless
login will be enabled.
3. Test Passwordless SSH Login
Now try logging in:
ssh username@192.168.203.209
Successfully login
-Shivaji Bedre