<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>SSH in BatchMode</TITLE>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2800.1543" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=244273206-23052006>I think the directorio must be
/etc/.ssh/</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=244273206-23052006>NO /etc/ssh/...</SPAN></FONT></DIV><BR>
<DIV class=OutlookMessageHeader lang=es dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>De:</B> rhn-users-bounces@redhat.com
[mailto:rhn-users-bounces@redhat.com] <B>En nombre de </B>Vikas
Rawat<BR><B>Enviado el:</B> martes, 23 de mayo de 2006 8:21<BR><B>Para:</B>
redhat-list@redhat.com; rhn-users@redhat.com<BR><B>Asunto:</B> [rhn-users] SSH
in BatchMode<BR></FONT><BR></DIV>
<DIV></DIV><!-- Converted from text/rtf format -->
<P><FONT face="Courier New" size=2>Hi All,</FONT> </P>
<P><FONT face="Courier New" size=2>We have a requirement of connecting two linux
machines for executing some scripts. These script will invoke SSH command to
login to the remote linux machine and execute some commands. We are able to do
so manually, but in batch mode (via scripts), we are prompted for a password. To
avoid it, the documentation for SSH says</FONT></P>
<P><FONT face="Courier New" size=2>1. Log in to the remote linux machine once
manually, to store the RSA key of the remote machine. After completing the step,
we cross checked and the key is rightly stored in
/etc/ssh/known_hosts</FONT></P>
<P><FONT face="Courier New" size=2>2. Generate the RSA/DSA keys on the client
machine and copy the public keys on the remote machine. The public keys should
be copied to a file ~/.ssh/authorized_keys on the remote machine. We have done
this as well. </FONT></P>
<P><FONT face="Courier New" size=2>3. We have also changed the file/directory
permission for ~/.ssh & ~/.ssh/authorized_key to be read-write for user only
by executing </FONT></P>
<P><FONT face="Courier New" size=2>>chmod -R 600 .ssh</FONT> </P>
<P><FONT face="Courier New" size=2>4. Additionally, we have created
~/.ssh/known_hosts at the client machine containing the RSA public key of remote
linux machine.</FONT></P>
<P><FONT face="Courier New" size=2>As per the documentation, we should now be
able to login on the remote linux machine without being prompted for the
password. For us, we still get a Permission denied error i.e. after invoking the
following command on client</FONT></P>
<P><FONT face="Courier New" size=2>>ssh -2o BatchMode=true -l
<usrlogin> <remoteLinuxMachine></FONT> <BR><FONT face="Courier New"
size=2>It results in </FONT><BR><FONT face="Courier New" size=2>> Permission
denied (publickey,gssapi-with-mic,password)</FONT> </P>
<P><FONT face="Courier New" size=2>Anyone has any idea on how to get through
this problem.</FONT> <BR><BR><FONT face="Courier New" size=2>The concerned files
containing the appropriate debug/configuration information are attached.</FONT>
</P>
<P><FONT face="Courier New" size=2>Regards,</FONT> <BR><FONT face="Courier New"
size=2>Vikas</FONT> </P>
<P><FONT face=Arial color=#000000 size=2><<ssh-debug3.log>>
</FONT><FONT face=Arial color=#000000 size=2><<remote.sshd_config>>
</FONT><FONT face=Arial color=#000000 size=2><<sshd-ddd.log>>
</FONT><FONT face=Arial color=#000000 size=2><<client.ssh_config>>
</FONT></P></BODY></HTML>