SSH
What is SSH?
SSH, or Secure Shell, is a network communication protocol that enables two computers/devices to communicate and share data.
2. Why is it called a Secure Shell?
Because communication between the host and client will be in an encrypted format.
3. More about SSH
The default port for SSH client connections is 22
We can change the default port and use one between 1024 and 32,767
SSH is also a command in Linux
It is used to access another Linux server or to access a Linux server from a terminal.
Syntax: ssh user_name@host(IP/Domain_name)
4. How to use SSH?
To use SSH, the SSH service must be installed on the Linux server
You can check using
rpm -qa | grep ssh, or
check the file /etc/ssh/sshd_config
If not already installed, then install the two
install openssh-clients openssh-server
and now enable SSH or check if it is enabled using
systemctl status sshd
5. Examples
-Access Linux server using Putty(free open source tool)
-Access a Linux server from another server
6. There are two ways to access a remote server
— without password(by passing the ssh key)
— by using password
a. How to access a remote server without
password?
If you frequently access the server, then it’s a good idea to
configure your SSH keys so that you can log in without
password.
Follow the steps below
- Generate A New SSH Key Pair on the local machine.
- Copy the public key to the remote machine.
- Log in to the remote server without password.
Step1: Generate an SSH key using
ssh-keygenYou can check the generated keys using
ls -l.ssh
cat ~/.ssh/id_rsa.pubStep2: Copy your public SSH key to remote server,
( on remote server it is copied under
~/.ssh/authorizedkeys file)
ssh-copy-id root@192.168 …Step3: Now connect without the server password
ssh username@SERVER_IPSSH will authenticate using your key.
Get VasuMi’s stories in your inbox
Join Medium for free to get updates from this writer.
Step4: Even easier step you can do: create an SSH alias
nano ~/.ssh/configHost myserver
HostName SERVER_IP
User username
IdentityFile ~/.ssh/id_ed25519Then simply:
ssh myserverAnd then Proceed. This way you can acess remote server without password.
b. With password
Step1: Connect to the server
From WSL/Ubuntu:
ssh username@SERVER_IPFor example:
ssh root@192.168.1.100Step2: Enter the password
You’ll see:
root@192.168.1.100's password:Type the server password and press Enter.
The password won’t appear on the screen while you type. That’s normal.
Step3: You’re connected
You’ll get something similar to:
root@server:~Now commands you run are executing on the remote server, not your own Windows PC.
To disconnect
exitSo the basic flow is:
Your PC/WSL
↓
ssh username@SERVER_IP
↓
Enter server password
↓
Remote Linux ServerIf you’re doing the SSH Remote Server Setup project, password authentication is useful initially, but the project specifically practices SSH key-based access afterward.
Thanks for reading..Happy coding.





