219
Chapter 15: Advanced Configuration
15.6 Secure Shell (SSH) Public Key Authentication
This section covers the generation of public and private keys in a Linux and Windows environment and configuring SSH for
public key authentication. The steps to use in a Clustering environment are:
• Generateanewpublicandprivatekeypair
• UploadthekeystotheMasterandtoeachSlaveConsoleServer
• Fingerprinteachconnectiontovalidate
15.6.1 SSH Overview
Popular TCP/IP applications such as telnet, rlogin, ftp,andotherstransmittheirpasswordsunencrypted.Doingthisacross
publicnetworksliketheInternetcanhavecatastrophicconsequences.Itleavesthedooropenforeavesdropping,connection
hijacking,andothernetwork-levelattacks.
SecureShell(SSH)isaprogramtologintoanothercomputeroveranetwork,toexecutecommandsinaremotemachine,
and to move files from one machine to another. It provides strong authentication and secure communications over insecure
channels.
OpenSSH,thedefactoopensourceSSHapplication,encryptsalltrafc(includingpasswords)toeffectivelyeliminatethese
risks.Additionally,OpenSSHprovidesamyriadofsecuretunnelingcapabilities,aswellasavarietyofauthenticationmethods.
OpenSSHistheportofOpenBSD'sexcellentOpenSSH[0]toLinuxandotherversionsofUnix.OpenSSHisbasedonthelast
freeversionofTatuYlonen'ssampleimplementationwithallpatent-encumberedalgorithmsremoved(toexternallibraries),all
knownsecuritybugsxed,newfeaturesreintroducedandmanyotherclean-ups.http://www.openssh.com/Theonlychangesin
the SSH implementation are:
• PAMsupport
• EGD[1]/PRNGD[2]supportandreplacementsforOpenBSDlibraryfunctionsthatareabsentfromotherversionsofUNIX
• Theconglesarenowin /etc/config. e.g.
o /etc/config/sshd_config instead of /etc/sshd_config
o /etc/config/ssh_config instead of /etc/ssh_config
o /etc/config/users/<username>/.ssh/ instead of /home/<username>/.ssh/
15.6.2 Generating Public Keys (Linux)
To generate new SSH key pairs use the Linux ssh-keygencommand.ThiswillproduceanRSAorDSApublic/privatekeypair
and you will be prompted for a path to store the two key files e.g. id_dsa.pub(thepublickey)andid_dsa(theprivatekey).For
example:
$ ssh-keygen -t [rsa|dsa]
Generatingpublic/private[rsa|dsa]keypair.
Enter file in which to save the key (/home/user/.ssh/id_[rsa|dsa]):
Enter passphrase (emptyfornopassphrase):
Enter same passphrase again:
Your identification has been saved in /home/user/.ssh/id_[rsa|dsa].
Your public key has been saved in /home/user/.ssh/id_[rsa|dsa].pub.
The key fingerprint is:
28:aa:29:38:ba:40:f4:11:5e:3f:d4:fa:e5:36:14:d6 user@server
$