<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7638.1">
<TITLE>SSH in BatchMode</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->

<P><FONT SIZE=2 FACE="Courier New">Hi All,</FONT>
</P>

<P><FONT SIZE=2 FACE="Courier New">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 SIZE=2 FACE="Courier New">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 SIZE=2 FACE="Courier New">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 SIZE=2 FACE="Courier New">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 SIZE=2 FACE="Courier New">>chmod -R 600 .ssh</FONT>
</P>

<P><FONT SIZE=2 FACE="Courier New">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 SIZE=2 FACE="Courier New">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 SIZE=2 FACE="Courier New">>ssh -2o BatchMode=true -l <usrlogin> <remoteLinuxMachine></FONT>

<BR><FONT SIZE=2 FACE="Courier New">It results in </FONT>

<BR><FONT SIZE=2 FACE="Courier New">> Permission denied (publickey,gssapi-with-mic,password)</FONT>
</P>

<P><FONT SIZE=2 FACE="Courier New">Anyone has any idea on how to get through this problem.</FONT>
<BR>

<BR><FONT SIZE=2 FACE="Courier New">The concerned files containing the appropriate debug/configuration information are attached.</FONT>
</P>

<P><FONT SIZE=2 FACE="Courier New">Regards,</FONT>

<BR><FONT SIZE=2 FACE="Courier New">Vikas</FONT>
</P>

<P><FONT FACE="Arial" SIZE=2 COLOR="#000000"> <<ssh-debug3.log>> </FONT><FONT FACE="Arial" SIZE=2 COLOR="#000000"> <<remote.sshd_config>> </FONT><FONT FACE="Arial" SIZE=2 COLOR="#000000"> <<sshd-ddd.log>> </FONT><FONT FACE="Arial" SIZE=2 COLOR="#000000"> <<client.ssh_config>> </FONT>
</P>

</BODY>
</HTML>