<?xml version="1.0" encoding="utf-8"?><!DOCTYPE article  PUBLIC '-//OASIS//DTD DocBook XML V4.4//EN'  'http://www.docbook.org/xml/4.4/docbookx.dtd'><article><articleinfo><title>MemberManual/ShellAccess/PasswordlessLogin</title><revhistory><revision><revnumber>44</revnumber><date>2021-10-17 03:04:21</date><authorinitials>RobinTempleton</authorinitials><revremark>ALL CAPS -&gt; bold or italic for security warnings</revremark></revision><revision><revnumber>43</revnumber><date>2021-09-28 18:52:05</date><authorinitials>RobinTempleton</authorinitials><revremark>start guix section</revremark></revision><revision><revnumber>42</revnumber><date>2017-04-29 17:54:40</date><authorinitials>StephenMichel</authorinitials><revremark>update fedora package name</revremark></revision><revision><revnumber>41</revnumber><date>2016-05-09 17:32:56</date><authorinitials>c-174-63-40-76.hsd1.ma.comcast.net</authorinitials></revision><revision><revnumber>40</revnumber><date>2016-05-09 17:31:46</date><authorinitials>c-174-63-40-76.hsd1.ma.comcast.net</authorinitials><revremark>Straight from the mouth of unkown_lamer</revremark></revision><revision><revnumber>39</revnumber><date>2013-10-17 06:00:58</date><authorinitials>DaniilFrumin</authorinitials><revremark>Another comment about GSSApiTrustDNS</revremark></revision><revision><revnumber>38</revnumber><date>2013-10-17 05:56:49</date><authorinitials>DaniilFrumin</authorinitials><revremark>Updating the ssh config for it to work with Heimdal</revremark></revision><revision><revnumber>37</revnumber><date>2013-01-13 18:10:05</date><authorinitials>ClintonEbadi</authorinitials><revremark>gnu/cat</revremark></revision><revision><revnumber>36</revnumber><date>2010-01-10 08:46:08</date><authorinitials>62.0.105.133</authorinitials></revision><revision><revnumber>35</revnumber><date>2009-11-25 09:03:15</date><authorinitials>wifi-gw.cli.di.unipi.it</authorinitials></revision><revision><revnumber>34</revnumber><date>2009-11-25 08:55:46</date><authorinitials>wifi-gw.cli.di.unipi.it</authorinitials><revremark>spelling</revremark></revision><revision><revnumber>33</revnumber><date>2009-10-22 19:40:33</date><authorinitials>hst-210-178.medicom.bg</authorinitials><revremark>I just followed the generic steps and it worked perfectly on a 64-bit ArchLinux machine.</revremark></revision><revision><revnumber>32</revnumber><date>2009-06-30 03:46:51</date><authorinitials>sca-ea-fw-1.Sun.COM</authorinitials></revision><revision><revnumber>31</revnumber><date>2008-08-27 22:49:15</date><authorinitials>netblock-68-183-203-20.dslextreme.com</authorinitials></revision><revision><revnumber>30</revnumber><date>2008-08-27 22:47:46</date><authorinitials>netblock-68-183-203-20.dslextreme.com</authorinitials></revision><revision><revnumber>29</revnumber><date>2008-08-24 16:05:54</date><authorinitials>netblock-68-183-203-20.dslextreme.com</authorinitials></revision><revision><revnumber>28</revnumber><date>2008-08-24 16:04:48</date><authorinitials>netblock-68-183-203-20.dslextreme.com</authorinitials></revision><revision><revnumber>27</revnumber><date>2008-08-24 16:03:08</date><authorinitials>netblock-68-183-203-20.dslextreme.com</authorinitials></revision><revision><revnumber>26</revnumber><date>2008-08-24 16:02:05</date><authorinitials>netblock-68-183-203-20.dslextreme.com</authorinitials></revision><revision><revnumber>25</revnumber><date>2008-08-24 16:00:14</date><authorinitials>netblock-68-183-203-20.dslextreme.com</authorinitials></revision><revision><revnumber>24</revnumber><date>2008-07-07 04:28:02</date><authorinitials>localhost</authorinitials><revremark>converted to 1.6 markup</revremark></revision><revision><revnumber>23</revnumber><date>2008-06-17 23:06:28</date><authorinitials>AdamMegacz</authorinitials></revision><revision><revnumber>22</revnumber><date>2008-06-17 16:32:57</date><authorinitials>AdamMegacz</authorinitials><revremark>ssh -&gt; mire</revremark></revision><revision><revnumber>21</revnumber><date>2008-05-09 21:44:09</date><authorinitials>DavidCrawshaw</authorinitials><revremark>simpler ssh_config exampler</revremark></revision><revision><revnumber>20</revnumber><date>2008-04-30 14:40:15</date><authorinitials>AdamChlipala</authorinitials><revremark>mire -&gt; ssh</revremark></revision><revision><revnumber>19</revnumber><date>2008-03-08 01:02:40</date><authorinitials>JustinLeitgeb</authorinitials><revremark>add debugging tip, re-arrange troubleshooting section a bit and update email address for help to hcoop-help.</revremark></revision><revision><revnumber>18</revnumber><date>2008-02-26 19:31:17</date><authorinitials>netblock-68-183-198-235.dslextreme.com</authorinitials></revision><revision><revnumber>17</revnumber><date>2008-01-06 20:42:54</date><authorinitials>80-219-208-107.dclient.hispeed.ch</authorinitials><revremark>kinit/klist and friends are available on Mac OS 10.3 as well.</revremark></revision><revision><revnumber>16</revnumber><date>2007-12-19 01:58:00</date><authorinitials>pool-71-245-167-55.bltmmd.fios.verizon.net</authorinitials><revremark>Mac OS X Tiger comment</revremark></revision><revision><revnumber>15</revnumber><date>2007-11-12 05:14:54</date><authorinitials>MichaelOlson</authorinitials><revremark>Fix link</revremark></revision><revision><revnumber>14</revnumber><date>2007-11-12 04:23:25</date><authorinitials>MichaelOlson</authorinitials><revremark>Overhaul</revremark></revision><revision><revnumber>13</revnumber><date>2007-11-12 04:14:58</date><authorinitials>MichaelOlson</authorinitials><revremark>Make part of member manual</revremark></revision><revision><revnumber>12</revnumber><date>2007-11-11 21:38:49</date><authorinitials>bzq-84-108-20-56.cablep.bezeqint.net</authorinitials></revision><revision><revnumber>11</revnumber><date>2007-06-05 02:50:45</date><authorinitials>AdamMegacz</authorinitials></revision><revision><revnumber>10</revnumber><date>2007-06-03 06:09:56</date><authorinitials>AnilNarayanan</authorinitials><revremark>Client side firewall setting for krb.</revremark></revision><revision><revnumber>9</revnumber><date>2007-06-03 03:42:21</date><authorinitials>MichaelOlson</authorinitials><revremark>Mention krb5-user package</revremark></revision><revision><revnumber>8</revnumber><date>2007-06-03 01:31:23</date><authorinitials>netblock-68-183-25-2.dslextreme.com</authorinitials></revision><revision><revnumber>7</revnumber><date>2007-06-03 01:29:58</date><authorinitials>netblock-68-183-25-2.dslextreme.com</authorinitials></revision><revision><revnumber>6</revnumber><date>2007-06-03 01:28:51</date><authorinitials>netblock-68-183-25-2.dslextreme.com</authorinitials></revision><revision><revnumber>5</revnumber><date>2007-06-03 01:28:32</date><authorinitials>netblock-68-183-25-2.dslextreme.com</authorinitials></revision><revision><revnumber>4</revnumber><date>2007-06-03 01:10:49</date><authorinitials>netblock-68-183-25-2.dslextreme.com</authorinitials></revision><revision><revnumber>3</revnumber><date>2007-06-03 01:10:39</date><authorinitials>netblock-68-183-25-2.dslextreme.com</authorinitials></revision><revision><revnumber>2</revnumber><date>2007-06-03 01:08:33</date><authorinitials>netblock-68-183-25-2.dslextreme.com</authorinitials></revision><revision><revnumber>1</revnumber><date>2007-06-03 01:07:57</date><authorinitials>netblock-68-183-25-2.dslextreme.com</authorinitials></revision></revhistory></articleinfo><para>This page explains how to log in to our servers without having to type in a password.  We use <ulink url="https://wiki.hcoop.net/MemberManual/ShellAccess/PasswordlessLogin/MitKerberos#">MitKerberos</ulink> for this rather than RSA/DSA public keys.  The main reason for doing so is <ulink url="https://wiki.hcoop.net/MemberManual/ShellAccess/PasswordlessLogin/MemberManual/DistributedSecurity#">MemberManual/DistributedSecurity</ulink>; please see that page if you feel that the procedures described below are unduly cumbersome. </para><para>An extra benefit is that passwordless logins using kerberos are noticably faster than passwordless logins using public key authentication.  This is because kerberos uses symmetric cryptography (which is faster) and requires fewer round-trips during the authentication process. </para><para>These instructions have been tested with the major unix variants (Debian, RedHat, Fedora, Ubuntu, MacOSX, etc). There are reports that the ssh client in certain minor distributions does not support this. </para><section><title>Prerequisites</title><itemizedlist><listitem><para>The <emphasis role="strong">openssh client 4.3</emphasis> or later.  Other versions may work, but we make no guarantees. </para></listitem><listitem><para>The <emphasis role="strong">Kerberos 5 client</emphasis>. </para></listitem></itemizedlist><para>Installation instructions for various platforms are given below: </para><section><title>On a Macintosh</title><para>For OS X 10.5 and later, no additional software is required for the instructions below to work; earlier versions of Mac OS X might work if you install the MacPorts version of kerberos+ssh (but no guarantees!).  For further details, check out <ulink url="https://wiki.hcoop.net/MemberManual/ShellAccess/PasswordlessLogin/MemberManual/TransferringFiles/OpenAFS#">MemberManual/TransferringFiles/OpenAFS</ulink>, and follow just the Kerberos instructions. </para></section><section><title>On Ubuntu or Debian GNU/Linux</title><para>You need the <code>openssh-client</code> and <code>krb5-user</code> packages: </para><screen><![CDATA[sudo apt-get install openssh-client krb5-user]]></screen></section><section><title>On Fedora GNU/Linux</title><para>You will need the <emphasis role="strong">krb5-workstation</emphasis> package: </para><screen><![CDATA[dnf -y install krb5-workstation]]></screen></section><section><title>On GNU Guix</title><para>You will need the <emphasis role="strong">mit-krb5</emphasis> package: </para><screen><![CDATA[guix install mit-krb5]]></screen></section></section><section><title>Instructions</title><para>Once a Kerberos client has been installed, you must obtain Kerberos tickets.  If your username is &quot;fred&quot;, you would do this by typing: </para><screen><![CDATA[kinit -f fred@HCOOP.NET]]></screen><para>Then type your password when prompted.  </para><itemizedlist><listitem override="none"><para><inlinemediaobject><imageobject><imagedata depth="16" fileref="https://wiki.hcoop.net/moin_static1911/moniker_bt/img/idea.png" width="16"/></imageobject><textobject><phrase>(!)</phrase></textobject></inlinemediaobject> Important: You <emphasis role="strong">must</emphasis> capitalize HCOOP.NET and you <emphasis role="strong">must not</emphasis> capitalize your user name. </para></listitem></itemizedlist><para>Next, make sure you have your tickets.  To do this, type </para><screen><![CDATA[klist]]></screen><para>You should see your tickets and their expiration dates. </para><para>Last, type </para><screen><![CDATA[ssh -oGSSAPIAuthentication=yes -oGSSAPIDelegateCredentials=yes fred@ssh.hcoop.net]]></screen><para><code>GSSAPI</code> is the &quot;generic name&quot; for Kerberos-like authentication protocols.  The first option tells your ssh client to use your Kerberos tickets to prove your identity to the hcoop servers.  The second option tells your ssh client that it is safe to entrust the hcoop servers with a copy of your tickets once you have authenticated. If it still asks you for a password, you might have to add the <code>-oGSSAPITrustDNS=yes</code> option. </para><para>Upon first invocation you might be asked to add the RSA public key of ssh.hcoop.net to the list of known hosts. This message looks something like this: </para><screen><![CDATA[The authenticity of host 'ssh.hcoop.net (69.90.123.68)' can't be established.
RSA key fingerprint is 52:5c:8c:f7:d7:bc:1b:f9:ef:39:5a:27:ac:72:8a:e1.
Are you sure you want to continue connecting (yes/no)?]]></screen><para>Type yes to permanently store the fingerprint in ~/.ssh/known_hosts . </para></section><section><title>Automating things</title><para>If you do this a lot, you can include the <code>GSSAPIAuthentication</code> and <code>GSSAPIDelegateCredentials</code> options in your <code>~/.ssh/config</code> file.  But you should <emphasis>not</emphasis> turn on <code>GSSAPIDelegateCredentials</code> for arbitrary hosts.  <emphasis role="strong">Make sure you only enable it for HCoop hosts!</emphasis>  You should never, ever use <code>GSSAPIDelegateCredentials</code> on a machine which is operated by somebody other than yourself and HCoop. </para><para>Here is an example entry for <code>~/.ssh/config</code>: </para><screen><![CDATA[Host hcoop
  HostName ssh.hcoop.net
  GSSAPIAuthentication yes
  GSSAPIDelegateCredentials yes
  GSSAPITrustDNS yes
  User fred]]></screen><para>This will allow you to type the following, instead of the longer command above. </para><screen><![CDATA[ssh hcoop]]></screen></section><section><title>Troubleshooting</title><para>Adding &quot;-vvv&quot; to the ssh command line makes it spit out lots of useful debugging information. </para><para>If you see something like the following in the output: </para><screen><![CDATA[debug1: Unspecified GSS failure.  Minor code may provide more information
Server not found in Kerberos database]]></screen><para>check to see if you have an /etc/hosts file with the host that you're trying to reach in it.  If there is an entry for this host, make sure that the fully-qualified domain name is listed first, before any aliases that you may be using. </para><section><title>Session freezes after ~5 min of inactivity</title><para>The likely cause is that you are trying to exchange Kerberos tickets and have none. </para></section><section><title>If it still doesn't work</title><para>See the <ulink url="https://wiki.hcoop.net/MemberManual/ShellAccess/PasswordlessLogin/MemberManual/ShellAccess/TroubleshootingKerberos#">Troubleshooting Kerberos</ulink> page for more diagnostics.  You may also send the output of your ssh command with the &quot;'-vvv'&quot; to hcoop-help and we'll try to figure things out from there. </para><!--rule (<hr>) is not applicable to DocBook--><para> <ulink url="https://wiki.hcoop.net/MemberManual/ShellAccess/PasswordlessLogin/CategoryMemberManual#">CategoryMemberManual</ulink> <ulink url="https://wiki.hcoop.net/MemberManual/ShellAccess/PasswordlessLogin/CategoryNeedsWork#">CategoryNeedsWork</ulink> </para></section></section></article>