Skip to Content
Linux Networking Cookbook
book

Linux Networking Cookbook

by Carla Schroder
November 2007
Beginner
642 pages
15h 43m
English
O'Reilly Media, Inc.
Content preview from Linux Networking Cookbook

7.3. Setting Up Host Keys for Simplest Authentication

Problem

You want to know how to set up OpenSSH to log in to a remote host, using the simplest method that it supports.

Solution

Using host-key authentication is the simplest way to set up remote SSH access. You need:

  • OpenSSH installed on the machine you want to log into remotely

  • The SSH daemon to be running on the remote server, and port 22 not blocked

  • SSH client software on the remote client

  • A Linux login account on the remote server

  • To distribute the public host key to the clients

Your OpenSSH installer should have already created the host keys. If it didn't, see the next recipe.

First, protect your private host key from accidental overwrites:

	# chmod 400 /etc/ssh/ssh_host_rsa_key

Next, the public host key must be distributed to the clients. One way is to log in from the client, and let OpenSSH transfer the key:

	foober@gouda:~$ ssh reggiano
	The authenticity of host 'reggiano (192.168.1.10)' can't be established.
	RSA key fingerprint is 26:f6:5b:24:49:e6:71:6f:12:76:1c:2b:a5:ee:fe:fe
	Are you sure you want to continue connecting (yes/no)?
	Warning: Permanently added 'reggiano 192.168.1.10' (RSA) to the list of known hosts.
	foober@reggiano's password:
	Linux reggiano 2.6.15 #1 Sun June 10 11:03:21 PDT 2007 i686 GNU/Linux
	Debian GNU/Linux
	Last login: S Sun June 10 03:11:49 PDT 2007 from :0.0
	foober@reggiano:~$

Now, Foober can work on Reggiano just as if he were physically sitting at the machine, and all traffic—including the initial login—is ...

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.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Linux Networking Cookbook

Linux Networking Cookbook

Gregory Boyce
Linux Security Cookbook

Linux Security Cookbook

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

Publisher Resources

ISBN: 9780596102487Errata Page