The user must have read access to the private key associated with the public key installed on the remote machine. That requires the private key to be 600 perms. ssh will fail otherwise.<br><br><br><div class="gmail_quote">
On Fri, Jan 13, 2012 at 3:57 PM, Tim Watts <span dir="ltr">&lt;<a href="mailto:tim@cliftonfarm.org">tim@cliftonfarm.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div class="im">On Fri, 2012-01-13 at 15:40 -0500, Jim Kinney wrote:<br>
&gt; On Fri, Jan 13, 2012 at 3:28 PM, David Tomaschik<br>
&gt; &lt;<a href="mailto:david@systemoverlord.com">david@systemoverlord.com</a>&gt; wrote:<br>
&gt;         You should have the public key in a file called<br>
&gt;         authorized_keys on the<br>
&gt;         server side.<br>
&gt;<br>
&gt; Yep! Easy tool is called ssh-copy-id &lt;user&gt;@&lt;hostname&gt;  will do the<br>
&gt; RightThing (tm) on the remote end.<br>
&gt;<br>
</div>Does root&#39;s authorized_keys need to have my public key in order for me<br>
to do &quot;ssh timtw@blueberry&quot;  from root?<br>
<br>
I can &quot;ssh blueberry&quot; as root using the key I gen&#39;ed but I can&#39;t &quot;ssh<br>
timtw@blueberry&quot; as root (get Permission denied (publickey)).  Same song<br>
when I tried to &quot;ssh-copy-id timtw@blueberry&quot; as root.<br>
<br>
It works when I&#39;m timtw no problem, using my key.<br>
<div class="im"><br>
&gt; Also you will need to edit the /etc/ssh/sshd_config file and change<br>
&gt;<br>
&gt; #PubkeyAuthentication yes<br>
&gt; #AuthorizedKeysFile    .ssh/authorized_keys<br>
&gt;<br>
&gt; to<br>
&gt;<br>
&gt; PubkeyAuthentication yes<br>
&gt; AuthorizedKeysFile    .ssh/authorized_keys<br>
&gt;<br>
</div>Already had that.  I can ssh as timtw with my ssh key no problem.<br>
<div class="HOEnZb"><div class="h5"><br>
&gt;<br>
&gt; For the back up process, you will want to put the key in the account<br>
&gt; of the backup user on the far machine (back up data storage system -<br>
&gt; wilma), not root user.<br>
&gt;<br>
&gt;<br>
&gt;         David<br>
&gt;<br>
&gt;<br>
&gt;         On Fri, Jan 13, 2012 at 3:06 PM, Tim Watts<br>
&gt;         &lt;<a href="mailto:tim@cliftonfarm.org">tim@cliftonfarm.org</a>&gt; wrote:<br>
&gt;         &gt; OK, I did an ssh-keygen for root and managed to copy its<br>
&gt;         id_rsa.pub to<br>
&gt;         &gt; $host:/root/.ssh.  (I have &quot;PasswordAuthentication no&quot; in my<br>
&gt;         sshd_config<br>
&gt;         &gt; so can&#39;t use ssh-copy-id.)  On the target host it shows<br>
&gt;         this:<br>
&gt;         &gt;<br>
&gt;         &gt; $ sudo ls -l /root/.ssh/<br>
&gt;         &gt; total 8<br>
&gt;         &gt; -rw-r--r-- 1 root root 396 <a href="tel:2012-01-13%2014" value="+12012011314">2012-01-13 14</a>:36 id_rsa.pub<br>
&gt;         &gt; -rw-r--r-- 1 root root 884 2010-11-28 13:36 known_hosts<br>
&gt;         &gt;<br>
&gt;         &gt; On my local machine I have this:<br>
&gt;         &gt;<br>
&gt;         &gt; # ls -l /root/.ssh<br>
&gt;         &gt; total 12<br>
&gt;         &gt; -rw------- 1 root root 1743 <a href="tel:2012-01-13%2014" value="+12012011314">2012-01-13 14</a>:25 id_rsa<br>
&gt;         &gt; -rw-r--r-- 1 root root  396 <a href="tel:2012-01-13%2014" value="+12012011314">2012-01-13 14</a>:25 id_rsa.pub<br>
&gt;         &gt; -rw-r--r-- 1 root root  884 2009-11-11 06:17 known_hosts<br>
&gt;         &gt;<br>
&gt;         &gt; The timestamp difference is due to copying it to my home<br>
&gt;         before scp-ing<br>
&gt;         &gt; it to the target host.<br>
&gt;         &gt;<br>
&gt;         &gt; And yet:<br>
&gt;         &gt;<br>
&gt;         &gt; # ssh timtw@blueberry<br>
&gt;         &gt; Permission denied (publickey).<br>
&gt;         &gt; # ssh blueberry<br>
&gt;         &gt; Permission denied (publickey).<br>
&gt;         &gt;<br>
&gt;         &gt; My sshd_config has &quot;PermitRootLogin yes&quot;.  What else could I<br>
&gt;         be missing?<br>
&gt;         &gt;<br>
&gt;         &gt;<br>
&gt;         &gt; On Fri, 2012-01-13 at 13:56 -0500, Jim Kinney wrote:<br>
&gt;         &gt;&gt; root user needs to do a keygen and put the pub on wilma.<br>
&gt;         &gt;&gt;<br>
&gt;         &gt;&gt; On Fri, Jan 13, 2012 at 1:40 PM, Tim Watts<br>
&gt;         &lt;<a href="mailto:tim@cliftonfarm.org">tim@cliftonfarm.org</a>&gt;<br>
&gt;         &gt;&gt; wrote:<br>
&gt;         &gt;&gt;         On Fri, 2012-01-13 at 11:51 -0500, Jim Kinney<br>
&gt;         wrote:<br>
&gt;         &gt;&gt;         &gt; root on fred goes to fredbak on wilma<br>
&gt;         &gt;&gt;<br>
&gt;         &gt;&gt;<br>
&gt;         &gt;&gt;         Just to be clear: does this mean that the backup<br>
&gt;         job runs as<br>
&gt;         &gt;&gt;         root but<br>
&gt;         &gt;&gt;         rsyncs as fredbak (via ssh key) to wilma?  As in:<br>
&gt;         &gt;&gt;<br>
&gt;         &gt;&gt;                # rsync $OPTS $SRC fredbak@$TGTHOST:$DST<br>
&gt;         &gt;&gt;<br>
&gt;         &gt;&gt;         I get an error when I try to do something similar:<br>
&gt;         &gt;&gt;<br>
&gt;         &gt;&gt;         OPTS=&quot;-az --delete-during --delete-delay -h<br>
&gt;         --progress<br>
&gt;         &gt;&gt;         --stats&quot;<br>
&gt;         &gt;&gt;<br>
&gt;         &gt;&gt;         # rsync $OPTS /etc /home/timtw<br>
&gt;         &gt;&gt;         timtw@blueberry:/home/timtw/backups/dellberry<br>
&gt;         &gt;&gt;         Permission denied (publickey).<br>
&gt;         &gt;&gt;         rsync: connection unexpectedly closed (0 bytes<br>
&gt;         received so<br>
&gt;         &gt;&gt;         far) [sender]<br>
&gt;         &gt;&gt;         rsync error: unexplained error (code 255) at<br>
&gt;         io.c(601)<br>
&gt;         &gt;&gt;         [sender=3.0.7]<br>
&gt;         &gt;&gt;         #<br>
&gt;         &gt;&gt;<br>
&gt;         &gt;&gt;         I am able to ssh to blueberry via my ssh key when<br>
&gt;         I&#39;m timtw<br>
&gt;         &gt;&gt;         but not as<br>
&gt;         &gt;&gt;         root.  Is my key in the wrong place?<br>
&gt;         &gt;&gt;<br>
&gt;         &gt;&gt;<br>
&gt;         &gt;&gt;         _______________________________________________<br>
&gt;         &gt;&gt;         Ale mailing list<br>
&gt;         &gt;&gt;         <a href="mailto:Ale@ale.org">Ale@ale.org</a><br>
&gt;         &gt;&gt;         <a href="http://mail.ale.org/mailman/listinfo/ale" target="_blank">http://mail.ale.org/mailman/listinfo/ale</a><br>
&gt;         &gt;&gt;         See JOBS, ANNOUNCE and SCHOOLS lists at<br>
&gt;         &gt;&gt;         <a href="http://mail.ale.org/mailman/listinfo" target="_blank">http://mail.ale.org/mailman/listinfo</a><br>
&gt;         &gt;&gt;<br>
&gt;         &gt;&gt;<br>
&gt;         &gt;&gt;<br>
&gt;         &gt;&gt;<br>
&gt;         &gt;&gt; --<br>
&gt;         &gt;&gt; --<br>
&gt;         &gt;&gt; James P. Kinney III<br>
&gt;         &gt;&gt;<br>
&gt;         &gt;&gt; As long as the general population is passive, apathetic,<br>
&gt;         diverted to<br>
&gt;         &gt;&gt; consumerism or hatred of the vulnerable, then the powerful<br>
&gt;         can do as<br>
&gt;         &gt;&gt; they please, and those who survive will be left to<br>
&gt;         contemplate the<br>
&gt;         &gt;&gt; outcome.<br>
&gt;         &gt;&gt; - 2011 Noam Chomsky<br>
&gt;         &gt;&gt;<br>
&gt;         &gt;&gt; <a href="http://heretothereideas.blogspot.com/" target="_blank">http://heretothereideas.blogspot.com/</a><br>
&gt;         &gt;&gt;<br>
&gt;         &gt;&gt; _______________________________________________<br>
&gt;         &gt;&gt; Ale mailing list<br>
&gt;         &gt;&gt; <a href="mailto:Ale@ale.org">Ale@ale.org</a><br>
&gt;         &gt;&gt; <a href="http://mail.ale.org/mailman/listinfo/ale" target="_blank">http://mail.ale.org/mailman/listinfo/ale</a><br>
&gt;         &gt;&gt; See JOBS, ANNOUNCE and SCHOOLS lists at<br>
&gt;         &gt;&gt; <a href="http://mail.ale.org/mailman/listinfo" target="_blank">http://mail.ale.org/mailman/listinfo</a><br>
&gt;         &gt;<br>
&gt;         &gt;<br>
&gt;         &gt; _______________________________________________<br>
&gt;         &gt; Ale mailing list<br>
&gt;         &gt; <a href="mailto:Ale@ale.org">Ale@ale.org</a><br>
&gt;         &gt; <a href="http://mail.ale.org/mailman/listinfo/ale" target="_blank">http://mail.ale.org/mailman/listinfo/ale</a><br>
&gt;         &gt; See JOBS, ANNOUNCE and SCHOOLS lists at<br>
&gt;         &gt; <a href="http://mail.ale.org/mailman/listinfo" target="_blank">http://mail.ale.org/mailman/listinfo</a><br>
&gt;         &gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;         --<br>
&gt;<br>
&gt;         David Tomaschik, RHCE, LPIC-1<br>
&gt;         System Administrator/Open Source Advocate<br>
&gt;         OpenPGP: 0x5DEA789B<br>
&gt;         <a href="http://systemoverlord.com" target="_blank">http://systemoverlord.com</a><br>
&gt;         <a href="mailto:david@systemoverlord.com">david@systemoverlord.com</a><br>
&gt;<br>
&gt;         _______________________________________________<br>
&gt;         Ale mailing list<br>
&gt;         <a href="mailto:Ale@ale.org">Ale@ale.org</a><br>
&gt;         <a href="http://mail.ale.org/mailman/listinfo/ale" target="_blank">http://mail.ale.org/mailman/listinfo/ale</a><br>
&gt;         See JOBS, ANNOUNCE and SCHOOLS lists at<br>
&gt;         <a href="http://mail.ale.org/mailman/listinfo" target="_blank">http://mail.ale.org/mailman/listinfo</a><br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; --<br>
&gt; James P. Kinney III<br>
&gt;<br>
&gt; As long as the general population is passive, apathetic, diverted to<br>
&gt; consumerism or hatred of the vulnerable, then the powerful can do as<br>
&gt; they please, and those who survive will be left to contemplate the<br>
&gt; outcome.<br>
&gt; - 2011 Noam Chomsky<br>
&gt;<br>
&gt; <a href="http://heretothereideas.blogspot.com/" target="_blank">http://heretothereideas.blogspot.com/</a><br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; Ale mailing list<br>
&gt; <a href="mailto:Ale@ale.org">Ale@ale.org</a><br>
&gt; <a href="http://mail.ale.org/mailman/listinfo/ale" target="_blank">http://mail.ale.org/mailman/listinfo/ale</a><br>
&gt; See JOBS, ANNOUNCE and SCHOOLS lists at<br>
&gt; <a href="http://mail.ale.org/mailman/listinfo" target="_blank">http://mail.ale.org/mailman/listinfo</a><br>
<br>
</div></div><br>_______________________________________________<br>
Ale mailing list<br>
<a href="mailto:Ale@ale.org">Ale@ale.org</a><br>
<a href="http://mail.ale.org/mailman/listinfo/ale" target="_blank">http://mail.ale.org/mailman/listinfo/ale</a><br>
See JOBS, ANNOUNCE and SCHOOLS lists at<br>
<a href="http://mail.ale.org/mailman/listinfo" target="_blank">http://mail.ale.org/mailman/listinfo</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>-- <br>James P. Kinney III<br><br>As long as the general population is passive, apathetic, diverted to 
consumerism or hatred of the vulnerable, then the powerful can do as 
they please, and those who survive will be left to contemplate the 
outcome.<br>- <i><i><i><i>2011 Noam Chomsky<br><br><a href="http://heretothereideas.blogspot.com/" target="_blank">http://heretothereideas.blogspot.com/</a><br></i></i></i></i><br>