Operating System - HP-UX
1834124 Members
2674 Online
110064 Solutions
New Discussion

rsh and ssh from Linux to HP-UX

 
SOLVED
Go to solution
Samuel Mathew
Frequent Advisor

rsh and ssh from Linux to HP-UX

Please help me with this rsh problem. I am running rsh to execute a command on another HP-UX machine. I give this command
rsh barny -l al "cat /home/al/list1" >> /tmp/list1.
If I do this from HP-UX (barny) to linux (fred) this works fine. If I do it from linux to HP-UX it hangs. I can see that it creates a file with /tmp/sam with 0 bytes. It is not able to execute it.
I have changed the security under /etc/pam.d/rsh on linux to "sufficient". I don't have kerberos on this machine? Is that a problem. I don't understand why this is not working? Can anybody have any experience in this?.
Since this didnt work, I tried ssh from linux to HP-UX ......
I tried ssh command
ssh barny -l al "cat /home/al/list1" >> /tmp/sam1
The error message is
ssh: connect to host barny port 22: Connection refused. How can this be tackled.? I do have l .rhosts file that contains all the machine names including this machine.
. If somebody can help me with setting up ssh, that will be appreciated too..
I just need either rsh or ssh to work. Both seems to be stcuk...
I would appreciate immediate help
Regards
Sam

8 REPLIES 8
Steven E. Protter
Exalted Contributor
Solution

Re: rsh and ssh from Linux to HP-UX

There are several possible causes, and the focus should be the Linux box.

Check out the iptables configuration on the Linux box and make sure the appropriate port is open.

For a quick test:

As root:

service iptables stop

re-run the test. If successful, you need to decide if you want to reconfigure the firewall.

Next, ssh is a better way to go here.

I'm attaching a great 2 page paper, written by Chris Vail that tells you exactly how to exchange public keys and get your command working in ssh.

port 22 will need to be open to traffic, two way on the Linux box.

In either instance, /etc/services must be correct on the Linux box.

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
Sachin Patel
Honored Contributor

Re: rsh and ssh from Linux to HP-UX

Hi Samuel,
add + in your /etc/hosts.equiv file on hp system just to test.
shell creates file first then runs the command if redirection is being used. so it is normal that you have a file with 0 byte.

Sachin
Is photography a hobby or another way to spend $
Steven E. Protter
Exalted Contributor

Re: rsh and ssh from Linux to HP-UX

Sachin's idea is better than mine.

So I have another one.

tail -f /var/adm/syslog/syslog.log on HP-UX

tail -f /var/log/messages on Linux.

Try the transfer, follow the messages where they lead.

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
Donny Jekels
Respected Contributor

Re: rsh and ssh from Linux to HP-UX

stop iptables and try again/
"Vision, is the art of seeing the invisible"
Jim Keeble
Trusted Contributor

Re: rsh and ssh from Linux to HP-UX

I'm not sure what is causing the rsh hang, but the "connection refused" from ssh is because the sshd process is not running on the HP. You can download ssh (Secure Shell) for 11.0 and 11.11 from software.hp.com.

Samuel Mathew
Frequent Advisor

Re: rsh and ssh from Linux to HP-UX

SEP,
Thanks. Your suggestion seems to be progressing except that I don't know how to open port 22. Since that is not open on HP-UX 10.20 box that we have, I get connection refused when I try ssh command on HP. I successfully got into a LInux box.
Please let me know the fundamentals of the port 22 open that i need to do.
Thanks for the help in advance.
Regards
Sam
Sachin Patel
Honored Contributor

Re: rsh and ssh from Linux to HP-UX

Hi Sam,
We don't use ssh in any of our hp system so I do't have a example for it. But all the ports are in /etc/services and /etc/inetd.conf file.

Sachin
Is photography a hobby or another way to spend $
Jim Keeble
Trusted Contributor

Re: rsh and ssh from Linux to HP-UX

HP does not supply or support ssh for HP-UX 10.20, but you can acquire it from www.openssh.org.

Your "rsh" (equivalent to remsh on HP-UX) problem could be a firewall issue . Remote Shell requires a first connection for the command from a reserved port on the Linux side(ports from 512-1023) to port 514 on the HP side. Then the HP gets a reserved port to listen for a connection for the data returned by the command, ie., the cat output. The Linux box tells the HP side what port to connect to via the command connection, then the HP side acquires another reserved port for the data, and connects from reserved port (512-1023) to reserved port (512-1023) on the Linux side, sends the output, and closes.

Bottom line, any firewall needs to pass connections to and from these reserved port ranges in order to allow remsh aka. rsh to function.