From the course: Red Hat Certified System Administrator (EX200) Cert Prep: 2 File Access, Storage, and Security

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Configure key-based authentication for SSH

Configure key-based authentication for SSH

From the course: Red Hat Certified System Administrator (EX200) Cert Prep: 2 File Access, Storage, and Security

Start my 1-month free trial

Configure key-based authentication for SSH

- [Tutor] There are multiple ways of authenticating using SSH but the two most common are passwords and private public key pairs. In this video, we'll configure private public key pairs for passwordless logins. The first step to passwordless logins is to generate the SSH key pair using the ssh-keygen command. In a terminal on rhhost1, type in ssh-keygen and hit enter. Go ahead and take the defaults when prompted. Since we did not pass it in the options, it created RSA, private and public keys. Let's verify this by listing the .ssh hidden directory. Type in clear and then type in ls -l ~/.ssh and hit enter. We can see that we have a file named id_rsa that is our private key. And we have a file named id_rsa.pub which is our public key. Now you need to copy the public key to your rhhost2 machine using its host name. We configured host names earlier in this course. Let's copy that public key across using the ssh-copy-id command. Type in ssh-copy-id rhhost2 and hit enter. Type in user…

Contents