SSH (Secure Shell) is mainly used to connect to a remote machine, allowing you to execute commands on it as if you were sitting right in front of it all while protecting that communication from being intercepted.
SSH consists of two parts:
SSH server : runs on the remote machine and listens for incoming connections, typically on port 22.
SSH client :runs on your local system and initiates the connection.
Let's have an example :
Suppose you want to connect to Charly's remote system and run some commands on his end. SSH makes this easy:
let's understand the command components :
charly ---> username on the remote system
remote-sys ---> remote system IP adress (1.1.1.1) or could be a domain name if it has one (example.com)
After running this command, you'll be prompted to enter Charly's password on that remote system. Once authenticated, your terminal becomes a mirror of Charly's and your prompt will change to something like:
charly@remote-sys $
now every command you type loaclly will travel in a secure encrypted tunnel to the remote machine and runs there. This makes remote command execution both efficient and secure.
To close the session and get back to your own terminal, simply type:
charly@remote-sys $ exit

Top comments (0)