Skip to Content
Practical Linux Security Cookbook
book

Practical Linux Security Cookbook

by Tajinder Kalsi
April 2016
Beginner to intermediate content levelBeginner to intermediate
276 pages
5h 32m
English
Packt Publishing
Content preview from Practical Linux Security Cookbook

Restricting remote access with key-based login into SSH

Even though SSH login is protected by using passwords for the user account, we can make it more secure by using key-based authentication into SSH.

Getting ready

To see how key-based authentication works, we will need two Linux systems (in our example, both our Ubuntu systems). One should have the OpenSSH server package installed on it.

How to do it...

To use key-based authentication, we need to create a pair of keys­—a private key and a public key.

  1. On the client or local system, we will execute the following command to generate the SSH key-pair:
    ssh-keygen-t rsa
    • The output obtained will be as follows:
  2. While creating the key, we can accept the default values or change them as per our wishes. It will ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Practical Linux Security Cookbook - Second Edition

Practical Linux Security Cookbook - Second Edition

Tajinder Kalsi
Linux Security Cookbook

Linux Security Cookbook

Daniel J. Barrett, Richard E. Silverman, Robert G. Byrnes

Publisher Resources

ISBN: 9781785286421Supplemental Content