<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.nodespace.com/wiki/history/SSH:Authorized_Keys?feed=atom</id>
	<title>SSH:Authorized Keys - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.nodespace.com/wiki/history/SSH:Authorized_Keys?feed=atom"/>
	<link rel="alternate" type="text/html" href="https://wiki.nodespace.com/wiki/history/SSH:Authorized_Keys"/>
	<updated>2026-04-20T08:11:52Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://wiki.nodespace.com/index.php?title=SSH:Authorized_Keys&amp;diff=171&amp;oldid=prev</id>
		<title>2600:8805:5200:260:8110:F6AD:B03B:514 at 01:28, 27 August 2023</title>
		<link rel="alternate" type="text/html" href="https://wiki.nodespace.com/index.php?title=SSH:Authorized_Keys&amp;diff=171&amp;oldid=prev"/>
		<updated>2023-08-27T01:28:43Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 01:28, 27 August 2023&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l75&quot;&gt;Line 75:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 75:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;h3&amp;gt;authorized_keys: restricting access&amp;lt;/h3&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;h3&amp;gt;authorized_keys: restricting access&amp;lt;/h3&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;What we have described above allows any remote host where the private key is known to make any kind of ssh connection (login, remote command execution, port forwarding, etc.) to the computer on which the &amp;lt;code&amp;gt;authorized_keys. There are a number of things that can be done in an authorized_keys to further restrict access.  These are all arranged by prefixing the line containing the public key by a single &quot;phrase&quot; of comma-separated options (see below for an example of what this winds up looking like)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;What we have described above allows any remote host where the private key is known to make any kind of ssh connection (login, remote command execution, port forwarding, etc.) to the computer on which the &amp;lt;code&amp;gt;authorized_keys&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/code&amp;gt;&lt;/ins&gt;. There are a number of things that can be done in an authorized_keys to further restrict access.  These are all arranged by prefixing the line containing the public key by a single &quot;phrase&quot; of comma-separated options (see below for an example of what this winds up looking like)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;h4&amp;gt;Host access list&amp;lt;/h4&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;h4&amp;gt;Host access list&amp;lt;/h4&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>2600:8805:5200:260:8110:F6AD:B03B:514</name></author>
	</entry>
	<entry>
		<id>https://wiki.nodespace.com/index.php?title=SSH:Authorized_Keys&amp;diff=170&amp;oldid=prev</id>
		<title>2600:8805:5200:260:8110:F6AD:B03B:514 at 01:26, 27 August 2023</title>
		<link rel="alternate" type="text/html" href="https://wiki.nodespace.com/index.php?title=SSH:Authorized_Keys&amp;diff=170&amp;oldid=prev"/>
		<updated>2023-08-27T01:26:11Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;a href=&quot;https://wiki.nodespace.com/index.php?title=SSH:Authorized_Keys&amp;amp;diff=170&amp;amp;oldid=169&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>2600:8805:5200:260:8110:F6AD:B03B:514</name></author>
	</entry>
	<entry>
		<id>https://wiki.nodespace.com/index.php?title=SSH:Authorized_Keys&amp;diff=169&amp;oldid=prev</id>
		<title>Travis: Created page with &quot;This article originally appeared on the [http://web.archive.org/web/20131003235025/http://www.eng.cam.ac.uk/help/jpmg/ssh/authorized_keys_howto.html University of Cambridge Engineering site].  &lt;h2&gt;Key generation&lt;/h2&gt;  &lt;h3&gt;Decisions to make&lt;/h3&gt;  &lt;h4&gt;Passphrase or not?&lt;/h4&gt; If you use a passphrase, the key will not    be useable unless you type the passphrase to make it available.   &lt;p&gt; So this is not helpful if you want ssh to run unattended for some    reason. &lt;p&gt; On th...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.nodespace.com/index.php?title=SSH:Authorized_Keys&amp;diff=169&amp;oldid=prev"/>
		<updated>2023-08-26T19:43:17Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;This article originally appeared on the [http://web.archive.org/web/20131003235025/http://www.eng.cam.ac.uk/help/jpmg/ssh/authorized_keys_howto.html University of Cambridge Engineering site].  &amp;lt;h2&amp;gt;Key generation&amp;lt;/h2&amp;gt;  &amp;lt;h3&amp;gt;Decisions to make&amp;lt;/h3&amp;gt;  &amp;lt;h4&amp;gt;Passphrase or not?&amp;lt;/h4&amp;gt; If you use a passphrase, the key will not    be useable unless you type the passphrase to make it available.   &amp;lt;p&amp;gt; So this is not helpful if you want ssh to run unattended for some    reason. &amp;lt;p&amp;gt; On th...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;This article originally appeared on the [http://web.archive.org/web/20131003235025/http://www.eng.cam.ac.uk/help/jpmg/ssh/authorized_keys_howto.html University of Cambridge Engineering site].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Key generation&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Decisions to make&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt;Passphrase or not?&amp;lt;/h4&amp;gt; If you use a passphrase, the key will not&lt;br /&gt;
   be useable unless you type the passphrase to make it available.  &lt;br /&gt;
&amp;lt;p&amp;gt; So this is not helpful if you want ssh to run unattended for some&lt;br /&gt;
   reason.&lt;br /&gt;
&amp;lt;p&amp;gt; On the other hand, it means that someone with temporary access to your&lt;br /&gt;
   account can&amp;#039;t just make a copy of the private key file and then use&lt;br /&gt;
   it subsequently&lt;br /&gt;
&amp;lt;h4&amp;gt;key type?&amp;lt;/h4&amp;gt; Unless you have good reason to do otherwise, allow&lt;br /&gt;
   the key generator to use its default (rsa for ssh-v2 connections).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Creating the key&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   You can create a private/public key pair (in the files&lt;br /&gt;
   &amp;lt;code&amp;gt;~/.ssh/filename&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;~/.ssh/filename.pub&amp;lt;/code&amp;gt;)&lt;br /&gt;
   that has no passphrase protecting the private key, by doing the&lt;br /&gt;
   following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   cd ~/.ssh&lt;br /&gt;
   ssh-keygen -f filename -C &amp;#039;Some comment&amp;#039; -N &amp;#039;&amp;#039; -t rsa -q&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   The two files created (&amp;lt;code&amp;gt;filename&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;filename.pub&amp;lt;/code&amp;gt;)&lt;br /&gt;
   can then be used as described below.&lt;br /&gt;
&amp;lt;p&amp;gt;   &lt;br /&gt;
   If on the other hand, you&amp;#039;d like to protect the private key file with&lt;br /&gt;
   a passphrase (which will be needed to be typed at any client that wants&lt;br /&gt;
   to use the key pair):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   cd ~/.ssh&lt;br /&gt;
   ssh-keygen -f filename -C &amp;#039;Some comment&amp;#039; -t rsa -q&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   and you&amp;#039;ll be prompted for a passphrase.  This has no limitation on&lt;br /&gt;
   length.  All the normal advice about non-guessable passwords may &lt;br /&gt;
   reasonably be applied to it, although it&amp;#039;s possible that a suitably&lt;br /&gt;
   long passphrase consisting of dictionary-attackable words can be just&lt;br /&gt;
   as secure as a short passphrase of random characters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;What the private/public key files are for&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   The private key is the secret one, not surprisingly.  It needs to&lt;br /&gt;
   be kept secure (not world-readable).  Only a client with knowledge&lt;br /&gt;
   of the private key can correctly respond to a challenge issued&lt;br /&gt;
   by a server that is using the public key.&lt;br /&gt;
   &amp;lt;p&amp;gt;&lt;br /&gt;
   If the private key is not passphrase protected, then the file&lt;br /&gt;
   containing it is particularly sensitive; even temporary exposure of&lt;br /&gt;
   your account to a third party could allow it to be copied and then&lt;br /&gt;
   used inappropriately.&lt;br /&gt;
   &amp;lt;p&amp;gt;&lt;br /&gt;
   If the private key is passphrase protected, then its vulnerability is&lt;br /&gt;
   lower;  an attacker would need a copy of the private key file, and&lt;br /&gt;
   &amp;lt;em&amp;gt;also&amp;lt;/em&amp;gt; to observe your keystrokes typing the passphrase to&lt;br /&gt;
   your client program (or to have inserted a trojan version of the&lt;br /&gt;
   client program, or ...).&lt;br /&gt;
&lt;br /&gt;
   The public key does not need to be kept secret; there is no&lt;br /&gt;
   practical way of guessing the private key that will match it.  It&lt;br /&gt;
   is put in your &amp;lt;code&amp;gt;~/.ssh/authorized_keys&amp;lt;/code&amp;gt; file on the&lt;br /&gt;
   machine that you want to connect to.  &lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
   There may be good reasons to keep the &amp;lt;code&amp;gt;authorized_keys&amp;lt;/code&amp;gt;&lt;br /&gt;
   file protected from world-readability (it may contain directives as&lt;br /&gt;
   to what machines may use a given key or what commands will be run&lt;br /&gt;
   in response to the use of a given key, which may be sensitive&lt;br /&gt;
   information) but protecting the public key is not one of them!&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Setting up an authorized_keys file&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   Once you&amp;#039;ve created your key pair, you can insert the public half&lt;br /&gt;
   of it into your authorized_keys file on computer &amp;quot;X&amp;quot;.  A client on&lt;br /&gt;
   computer &amp;quot;Y&amp;quot; that knows the private key can then authenticate to&lt;br /&gt;
   your account on computer &amp;quot;X&amp;quot;.&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
   So, on the machine you want to log into, you should add a line to&lt;br /&gt;
   your &amp;lt;code&amp;gt;~/.ssh/authorized_keys&amp;lt;/code&amp;gt; file that contains exactly&lt;br /&gt;
   the single line that was created in the &amp;lt;code&amp;gt;filename.pub&amp;lt;/code&amp;gt;&lt;br /&gt;
   file (for whatever choice of &amp;quot;filename&amp;quot; you made).&lt;br /&gt;
&amp;lt;p&amp;gt; &lt;br /&gt;
   For example, we might wind up with a &amp;lt;code&amp;gt;.ssh/authorized_keys&amp;lt;/code&amp;gt;&lt;br /&gt;
   file that looks like:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAybmcqaU/Xos/GhYCzkV+kDsK8+A5OjaK&lt;br /&gt;
5WgLMqmu38aPo56Od10RQ3EiB42DjRVY8trXS1NH4jbURQPERr2LHCCYq6tHJYfJNhUX&lt;br /&gt;
/COwHs+ozNPE83CYDhK4AhabahnltFE5ZbefwXW4FoKOO+n8AdDfSXOazpPas8jXi5bE&lt;br /&gt;
wNf7heZT++a/Qxbu9JHF1huThuDuxOtIWl07G+tKqzggFVknM5CoJCFxaik91lNGgu2O&lt;br /&gt;
TKfY94c/ieETOXE5L+fVrbtOh7DTFMjIYAWNxy4tlMR/59UVw5dapAxH9J2lZglkj0w0&lt;br /&gt;
LwFI+7hZu9XvNfMKMKg+ERAz9XHYH3608RL1RQ== This comment describes the &lt;br /&gt;
key&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
   except that I have deliberately split the single long line to make &lt;br /&gt;
it more readable.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Making an ssh connection using a private key&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;   &lt;br /&gt;
   On the machine you want to log in &amp;lt;em&amp;gt;from&amp;lt;/em&amp;gt; you would run&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   slogin -i ~/.ssh/filename remotehost&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;p&amp;gt;&lt;br /&gt;
   (for appropriate values of &amp;quot;filename&amp;quot; and &amp;quot;remotehost&amp;quot;) thus&lt;br /&gt;
   telling slogin to look in the private key file.&lt;br /&gt;
&amp;lt;p&amp;gt; &lt;br /&gt;
   The connection would then be made without any further authentication&lt;br /&gt;
   being necessary (although &amp;lt;code&amp;gt;slogin&amp;lt;/code&amp;gt; would prompt for a &lt;br /&gt;
   passphrase if the private key were protected by one.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;authorized_keys : restricting access&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
   What we have described above allows any remote host where the private&lt;br /&gt;
   key is known to make any kind of ssh connection (login, remote command&lt;br /&gt;
   execution, port forwarding, etc.) to the computer on which the&lt;br /&gt;
   &amp;lt;code&amp;gt;authorized_keys&amp;lt;/code.&amp;gt;&lt;br /&gt;
   There are a number of things that can be done in an authorized_keys to&lt;br /&gt;
   further restrict access.  These are all arranged by prefixing the&lt;br /&gt;
   line containing the public key by a single &amp;quot;phrase&amp;quot; of comma-separated &lt;br /&gt;
   options (see below for an example of what this winds up looking like)&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h4&amp;gt;Host access list&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
   If the options phrase at the beginning of a line contains the&lt;br /&gt;
   keyword &amp;lt;code&amp;gt;from=&amp;quot;string&amp;quot;&amp;lt;/code&amp;gt; this restricts the use of the&lt;br /&gt;
   key on that line to sessions that originate from hosts that match&lt;br /&gt;
   &amp;lt;code&amp;gt;&amp;quot;string&amp;quot;&amp;lt;/code&amp;gt;.  Examples might be&lt;br /&gt;
&amp;lt;/p&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
   from=&amp;quot;trusted.eng.cam.ac.uk&amp;quot;&lt;br /&gt;
   from=&amp;quot;*.eng.cam.ac.uk,!untrusted.eng.cam.ac.uk&amp;quot;&lt;br /&gt;
   from=&amp;quot;tw?00.eng.cam.ac.uk&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;p&amp;gt;&lt;br /&gt;
   The hostname used will need to be the hostname reported when the IP&lt;br /&gt;
   (network) address of the connecting machine is looked up in the DNS.&lt;br /&gt;
   The &amp;lt;code&amp;gt;*&amp;lt;/code&amp;gt; wildcard matches one or more characters, while the&lt;br /&gt;
   &amp;lt;code&amp;gt;?&amp;lt;/code&amp;gt; wildcard matches a single character.  If the connecting&lt;br /&gt;
   hostname matches an entry prefixed by &amp;#039;!&amp;#039;, then it will be rejected.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h4&amp;gt;Forced command&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
   If the options phrase at the beginning of a line contains the keyword&lt;br /&gt;
   &amp;lt;code&amp;gt;command=&amp;quot;string&amp;quot;&amp;lt;/code&amp;gt;, then any ssh connection that authenticates&lt;br /&gt;
   using that particular key will &amp;lt;em&amp;gt;only&amp;lt;/em&amp;gt; run the command specified,&lt;br /&gt;
   even if the command line it was given specified another command.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h4&amp;gt;Other options&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
   Various ssh facilities may be suppressed by adding the following options&lt;br /&gt;
   to the options phrase at the beginning of a line:&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;p&amp;gt;   &lt;br /&gt;
   When heavily restricting an ssh key in circumstances where entirely&lt;br /&gt;
   automated remote connections are desired, it is generally a good idea&lt;br /&gt;
   to apply all of these options unless the command being run actually&lt;br /&gt;
   needs one of these facilities.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h4&amp;gt;Example authorized_keys file&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
This example file has two entries.  Note that there is no whitespace&lt;br /&gt;
in the list of options; they are separated by commas, and strings are&lt;br /&gt;
double-quoted (eg in the argument to &amp;lt;code&amp;gt;from=&amp;lt;/code&amp;gt;).&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#&lt;br /&gt;
# comments are ignored in authorized_keys files&lt;br /&gt;
#&lt;br /&gt;
from=&amp;quot;trusted.eng.cam.ac.uk&amp;quot;,no-port-forwarding,no-pty ssh-rsa AAAAB&lt;br /&gt;
3NzaC1yc2EAAAABIwAAAQEAybmcqaU/Xos/GhYCzkV+kDsK8+A5OjaK5WgLMqmu38aPo&lt;br /&gt;
56Od10RQ3EiB42DjRVY8trXS1NH4jbURQPERr2LHCCYq6tHJYfJNhUX/COwHs+ozNPE8&lt;br /&gt;
3CYDhK4AhabahnltFE5ZbefwXW4FoKOO+n8AdDfSXOazpPas8jXi5bEwNf7heZT++a/Q&lt;br /&gt;
xbu9JHF1huThuDuxOtIWl07G+tKqzggFVknM5CoJCFxaik91lNGgu2OTKfY94c/ieETO&lt;br /&gt;
XE5L+fVrbtOh7DTFMjIYAWNxy4tlMR/59UVw5dapAxH9J2lZglkj0w0LwFI+7hZu9XvN&lt;br /&gt;
fMKMKg+ERAz9XHYH3608RL1RQ== This comment describes key #1&lt;br /&gt;
# &lt;br /&gt;
# this one should be restricted so that only machines with hostnames&lt;br /&gt;
# matching *.eng.cam.ac.uk can use it.&lt;br /&gt;
# &lt;br /&gt;
from=&amp;quot;*.eng.cam.ac.uk&amp;quot;,no-X11-forwarding,noagent-forwarding ssh-rsa &lt;br /&gt;
AAAAC4MybC1yc2EAAAABIwAAAQEAybmcqaU/Xos/GhYCzkV+kDsK8+A5OjaK5WgLMqm&lt;br /&gt;
u38aPo56Od10RQ3EiB42DjRVY8trXS1NH4jbURQPERr2LHCCYq6tHJYfJNhUX/COwHs&lt;br /&gt;
+ozNPE83CYDhK4AhabahnltFE5ZbefwXW4FoKOO+n8AdDfSXOazpPas8jXi5bENf7he&lt;br /&gt;
ZT++a/Qxbu9JHF1huThuDuxOtIWl07G+tKqzggFVknM5CoJCFxaik91lNGgu2OTKfY9&lt;br /&gt;
4c/ieETOXE5L+fVrbtOh7DTFMjIYAWNxy4tlMR/59UVw5dapAxH9J2lZglkj0w0LwFI&lt;br /&gt;
+7hZu9XvNfMKMKg+ERAz9XHYH3608RL1RQ== This comment describes key #2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;p&amp;gt;&lt;br /&gt;
Note that in reality, such a file would only have two uncommented&lt;br /&gt;
lines, both of them very long.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;If it doesn&amp;#039;t work&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
There are a number of reasons why key authentication might not work.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h4&amp;gt;Wrong keys&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;First, check that you really have put the matching public key in&lt;br /&gt;
the &amp;lt;code&amp;gt;~/.ssh/authorized_keys&amp;lt;/code&amp;gt; file on the machine you&amp;#039;re&lt;br /&gt;
trying to connect &amp;lt;em&amp;gt;to&amp;lt;/em&amp;gt;, and that you&amp;#039;re telling your ssh&lt;br /&gt;
client about the correct private key using the &amp;lt;code&amp;gt;-i&amp;lt;/code&amp;gt;&lt;br /&gt;
argument.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h4&amp;gt;Keys the wrong way round&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The public key goes in the destination host&amp;#039;s&lt;br /&gt;
&amp;lt;code&amp;gt;~/.ssh/authorized_keys&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The private key is needed on the machine you&amp;#039;re running ssh or slogin from.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h4&amp;gt;File permissions&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Some clients and servers are very picky about file permissions on their&lt;br /&gt;
configuration files.  Among possible objections they may have are:&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;a key file being writable by anyone other than the user (eg &lt;br /&gt;
 group-writable)&lt;br /&gt;
&amp;lt;li&amp;gt;a private key file being readable by anyone other than the user.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;h4&amp;gt;Wrong ssh protocol version&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
Most ssh clients and servers support both v1.5 and v2 of the ssh protocol.&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
Sometimes, however, they&amp;#039;ll both decide to prefer v1.5 even though they &lt;br /&gt;
both support v2.  In such cases, your ssh-rsa key (which is v2 compliant)&lt;br /&gt;
won&amp;#039;t work.&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;em&amp;gt;Solution&amp;lt;/em&amp;gt;:  Force v2 by using the &amp;lt;code&amp;gt;-2&amp;lt;/code&amp;gt; flag to ssh or&lt;br /&gt;
slogin&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     ssh -2 -i ~/.ssh/my_private_key remotemachine&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;h4&amp;gt;failure to use the right authentication mechanisms&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The client can be configured to request particular authentication mechanisms&lt;br /&gt;
in a particular order.  A non-standard local configuration file can &lt;br /&gt;
therefore potentially lead the client to prompt for a password before&lt;br /&gt;
in a particular ordera successful keybased authentication&lt;br /&gt;
can occur.&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The following options passed to ssh or slogin should compel the client to&lt;br /&gt;
only offer/try the key-based authentication mechanism only:&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   ssh -2 -i ~/.ssh/my_private_key \&lt;br /&gt;
       -o &amp;#039;PasswordAuthentication no&amp;#039; \&lt;br /&gt;
       -o &amp;#039;ChallengeResponseAuthentication no&amp;#039; \&lt;br /&gt;
       -o &amp;#039;PreferredAuthentications publickey&amp;#039; \&lt;br /&gt;
       remotemachine&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
This may be a useful way of minimising the chances of an entirely autonomous&lt;br /&gt;
ssh-based command execution failing due to attempting a user interaction.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>Travis</name></author>
	</entry>
</feed>