Operating System - HP-UX
1748228 Members
4466 Online
108759 Solutions
New Discussion

Re: Connection problem using remsh

 
SOLVED
Go to solution
Wilder Mellotto
Frequent Advisor

Connection problem using remsh

Hi.

 

We have two HPUX 11.31 and we need to execute some remote commands using remsh from server A to server B. We don't have problems hen this command is executed with root user, but when this command is executed with the flag -l user then we have the message remshd: Login incorrect.

 

This lines shows the problem and the command running without problem. In server B we have configured $HOME/.rhosts in root and pr0adm user with one line with the host A.

 

ROOT USER

root@Aserver # remsh Bserver ls /tmp/qps   --> OK

qpart.rpc

 

root@Aserver # remsh Bserver -l root ls /tmp/qps --> OK

qpart.rpc

 

QPART USER

qpart@Aserver # remsh Bserver ls /tmp/qps   --> OK

qpart.rpc

 

qpart@Aserver # remsh Bserver -l qpart ls /tmp/qps --> OK

qpart.rpc

 

PROBLEM: running remsh from root user using -l qpart

 

root@Aserver # remsh Bserver -l qpart ls /tmp/qps --> PROBLEM

remshd: Login incorrect.

We need run some commands from root user but these command must be executed with qpart user. Is there a way to do this connection?

 

 

Thanks.

6 REPLIES 6
Patrick Wallek
Honored Contributor

Re: Connection problem using remsh

You need to have an entry in the .rhosts file for the qpart user on Bserver that allows the remsh connection from root on Aserver.

 

For example an entry like the following in the .rhosts file for the qpart user:

 

aserver root

Wilder Mellotto
Frequent Advisor

Re: Connection problem using remsh

This is already done. As you can see in those command above, the connection passwd when the remsh is executed from user qpart to Bserver without problems.

 

Bserver # cat /.rhosts
Aserver

 

Bserver # cat /home/qpart/.rhosts
Aserver

 

 

The .rhosts configuration is ok. I don't have any clues at the moment.

Patrick Wallek
Honored Contributor

Re: Connection problem using remsh

No, it is not.  If just the hostname is specified in .rhosts, then only the SAME USER from the system specified will be allowed.

 

To allow another user, the hostname AND user name must be specified.

 

Try adding

 

Aserver root

 

to /home/qpart/.rhosts

Patrick Wallek
Honored Contributor
Solution

Re: Connection problem using remsh

OK, here are some examples using remsh between two test servers, sg1 and sg2 using accounts root and blh.

 

On sg2 the .rhosts for root is:

 

# cat /.rhosts
sg1

 

On sg2 the .rhosts for user blh is:

 

# cat /home/blh/.rhosts
sg1

 

 

Now on SG1 the results of the remsh are:

 

running remsh as root on SG1 and going to root on SG2:

# remsh sg2 uname -a
HP-UX sg2 B.11.23 U 9000/800 111901597 unlimited-user license

 

running remsh as blh on SG1 on going to blh on SG2:

$ remsh sg2 uname -a
HP-UX sg2 B.11.23 U 9000/800 111901597 unlimited-user license

 

running remsh as root on SG1 and going to blh on SG2:

# remsh sg2 -l blh uname -a
remshd: Login incorrect.

 

Oh, it failed!  Hmmm...

 

Now I added the line 'sg1 root' to the /home/blh/.rhosts file on sg2 so it now looks like:

 

# cat /home/blh/.rhosts
sg1
sg1 root

 

Now let's try remsh from root on SG1 to blh on SG2:

 

# remsh sg2 -l blh uname -a
HP-UX sg2 B.11.23 U 9000/800 111901597 unlimited-user license

 

Now it works! 

 

So you need 'Aserver root' to the /home/qpart/.rhosts on your Bserver to get this to work.

Wilder Mellotto
Frequent Advisor

Re: Connection problem using remsh

Wow, this really was a great answer, because really the setting that I had done was wrong, did not have that information I needed to insert the row containing the release of root access on my user qpart. This was his answer really the solution.

Now that will help me with a connection to another server? This case is the SAP Central Instance is running a Microsoft suite of RSH with the user domain qpart, but I've tried various types of user account and the e note this does not allow authentication to qpart. Is there a way to make a debug and check which user is coming from the Central Instance server?

Dennis Handly
Acclaimed Contributor

Re: Connection problem using remsh

>Now that will help me with a connection to another server?

 

The machine name in the .rhosts file is the source machine and user.

 

>I've tried various types of user account and the e note this does not allow authentication to qpart. Is there a way to make a debug and check which user is coming from the Central Instance server?

 

You could also use FQDN or IP addresses for the source machine.

And if you do it interactively with rlogin and actually type the password, you can get the name of the source machine with "who -u" or using "last -R -x" for user's host and long format.