Skip to main content

Getting Started with SSH

Chapter 6: Your First SSH Connection

In this Chapter 6, learn how to make your first SSH connection, understand host key verification, manage the known_hosts file, and follow the complete SSH session lifecycle from start to finish.

In the previous chapter, you learned how to get SSH installed and ready on Windows. By now, you have SSH set up on your machine regardless of your operating system. It is time to use it.

In this chapter, you will make your very first SSH connection to a remote server. You will learn the exact command syntax, understand what happens when you connect for the first time, and learn how SSH verifies and remembers servers using the known_hosts file.

The Basic SSH Command

The syntax for connecting to a remote server with SSH is straightforward:

ssh user@hostname

Where:

  • user - the username you want to log in as on the remote server.
  • hostname - the IP address or domain name of the remote server.

For example, to connect to a server with IP 192.168.1.100 as the user ravi:

ssh [email protected]

Or using a domain name:

ssh [email protected]

By default, SSH connects on port 22. If your server runs SSH on a different port, use the -p flag to specify it:

ssh -p 2222 [email protected]

What Happens During Your First SSH Connection

Pro TecMint Β· Root Plan
This Article is for Root Members
Join Root to read the full article and unlock everything

Full Access to Every Article, Course & Certification Track

Join thousands of Linux professionals who use Pro TecMint to advance their careers.

Ad-free access to all premium articles
All courses: Learn Linux, Bash, Golang, Ubuntu and more
RHCSA, RHCE, LFCS & LFCA certification prep
New courses added every month
Private Telegram community & priority support
Root Plan
$8/mo
or $59/year billed annually
Save $37 with annual plan
Start Reading This Article in the Next 60 Seconds
Join Root Plan β†’