Operating System - HP-UX
1832298 Members
2218 Online
110041 Solutions
New Discussion

Windows batch file to run a HP-UX script on a remote machine

 
SOLVED
Go to solution
Taurian
Valued Contributor

Windows batch file to run a HP-UX script on a remote machine

Hello All,

Can anyone please tell me how to configure the "OpenSSH" software so that it does not prompt for a password?

The scenario is that I want to shutdown HP-UX machines from a Windows machine. I want to create a batch file in windows that will run shutdown scripts in all the servers one by one. This I want to do without any human intervention.

I have installed "OpenSSH" on my windows machine and executed 'ssh root@'. Initially it showed an RSA key. I made a text file in windows and put the key in it and then copied it to the '/home/root/.ssh' directory on my server that is running HP-UX. It does not show the key when I run 'ssh root@' on windows, but it prompts for a password, for which human intervention is required.

Please let me know what step I am missing.

Same problem with using rexec command.
6 REPLIES 6
IT_2007
Honored Contributor

Re: Windows batch file to run a HP-UX script on a remote machine

copy public key to authorized_keys file on remote machine under home-directory/.ssh then it won't ask for password.
Taurian
Valued Contributor

Re: Windows batch file to run a HP-UX script on a remote machine

Srini_2007:
This is still not working. I generated a file through ssh-keygen and renamed it to 'authorized_keys' and copied it to remote machine in the directory '/home/.ssh/'. This didn't work. I also created this file on remote machine and pasted only the rsa key into it. This didn't work either. It is still asking for the password.
Patrice Le Guyader
Respected Contributor

Re: Windows batch file to run a HP-UX script on a remote machine

Hi,

Take a look at this doc (from Senthil Prabu.S). It's between two solaris boxes but it's the same principle.

hope this helps
Kenavo
Pat
Good judgement comes with experience. Unfortunately, the experience usually comes from bad judgement.
Steven E. Protter
Exalted Contributor
Solution

Re: Windows batch file to run a HP-UX script on a remote machine

Shalom,

Besides my religous objection to Windows boxes being permitted to run batch on HP-UX(joke), this is still a basic ssh issue.

Their needs to be the same user on both systems. ie, if you want root to run the job on HP-UX it needs to come from a windows user named root.

The ownership of the folder and permissions must be very precise or ssh will keep prompting for a password.

Try to set this up between to HP-UX boxes so that you know the Unix permissions. Then use the Windows GUI to match this as closely as possible.

Also see this document
http://www.hpuxconsulting.com/5004.ppt

You may need a different windows ssh client to make this work properly.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Marvin Strong
Honored Contributor

Re: Windows batch file to run a HP-UX script on a remote machine

it has to be /home/{username}/.ssh/authorized_keys

where username is the name of the user whom your are connecting as.

thus ssh -l mstrong server1 scriptname

/home/mstrong/.ssh/authorized_keys needs the key. Also the permissions on that file and directory need to be 600.

Taurian
Valued Contributor

Re: Windows batch file to run a HP-UX script on a remote machine

My $HOME variable on server is "/". Therefore, I am creating the directory "/.ssh/".

I have done everything that you guys have mentioned. But the password prompt is still there.

This is what I have done:

Windows> ssh-keygen -t rsa
Windows> copied id_rsa.pub to HP-UX server

HP-UX> touch /.ssh/authorized_keys
HP-UX> cat id_rsa.pub >> /.ssh/authorized_keys
HP-UX> chmod 600 /.ssh/authorized_keys

Windows> ssh root@ap1

Here it asks for a password. The above mentioned steps are all I have performed. What is it that I am missing??