Operating System - HP-UX
1834178 Members
2559 Online
110064 Solutions
New Discussion

remsh not working with command.

 
Jesús Couto Fandiño
Occasional Advisor

remsh not working with command.

Hi. First post to this forum, hope you can help with this...

For all the "wrong" reasons, I need to have remsh set up so root on one machine can execute some commands on another, at least to get things working till I can set up something more secure. Lets call them AAAA and BBBB

So I set up BBBB's ~root/.rhosts this way:

AAAAA root

mode 600 and all that. And it works from AAAA when I do something like

# remsh BBBB -l root

, login in without asking password. But if I try to add a command to execute, like

# remsh BBBB -l root ls

Then I get:

remshd: Login incorrect.

? What?

Now this works with another machine, CCCC, that seems to have an older remshd, but I really dont have any idea why the login fails in the second example.

Thanks in advance!

Jesús Couto F.

9 REPLIES 9
Sivakumar TS
Honored Contributor

Re: remsh not working with command.


Dear Jesús Couto,

Execute the following command ,

# remsh BBBB -l root -n ls

This will work !

Infact you have missed the "-n" before the command ( ls )

With Regards,

Siva.


Nothing is Impossible !
Robert-Jan Goossens_1
Honored Contributor

Re: remsh not working with command.

Hi Jesús,

remsh host [-l username] [-n] command

# remsh BBBB -l root -n ls

Regards,
Robert-Jan
Jesús Couto Fandiño
Occasional Advisor

Re: remsh not working with command.

Sorry, but no luck.

# remsh BBBB -l root -n ls
remshd: Login incorrect.

Still does it. And again, it works with and without the -n option with the CCCC host...
Chan 007
Honored Contributor

Re: remsh not working with command.

Have you added .rhosts file to all 3 systems?
If not do it.

Also check that you have /etc/services has entry for "shell". Which allows you to run cmd from other remote systems.

Finally if not working use hosts.equiv for each users...

Cheers...007
Jairo Campana
Trusted Contributor

Re: remsh not working with command.

add BBB to /etc/hosts
10.1.1.10 BBB

ping BBB

remsh BBB ls -la

send output /etc/resolv.conf
send output /etc/nsswitch.conf

cat $HOME/.rhosts : in the remote hosts




legionx
Victor BERRIDGE
Honored Contributor

Re: remsh not working with command.

Hi,
Do this for validation purpose
1)Check your boxes know each other!
By adding them in /etc/hosts
Then in the .rhosts in the root's home directory
make sure you have for each host you want, a line with
root


2)from host1 type
remsh host2 -n date

This should work
(I just tested but not with root)

All the best
Victor
Jesús Couto Fandiño
Occasional Advisor

Re: remsh not working with command.

Nothing.

To recapitulate.

Host CCCC is working. It has AAAA on /etc/hosts, and in root's .rhosts it has

AAAA root

So, from AAAA

#remsh CCCC -l root -n date
Fri Dec 9 15:49:48 MET 2005
------------

Now BBBB. BBBB has AAAA in /etc/hosts ... in fact, first difference; I had to add the domain, it didnt work with the hostname alone, so its something like
1.1.1.1 AAAA AAAA.A.A

and in root's .rhosts

AAAA.A.A root

Now, this does work without a command:

#remsh BBBB -l root

gives me a root shell on BBBB. But

#remsh BBBB -l root -n date
remshd: Login incorrect.

Why adding a command makes the login incorrect?
Jesús Couto Fandiño
Occasional Advisor

Re: remsh not working with command.

Ok, "found" the problem.

Back when I was trying to get it to run at all, I had changed the /etc/inetd.conf file of BBBB so it had the same line as CCCC where it worked. The only difference between them was that BBBB had "tcp6" as the protocol, while CCCC had "tcp"

Now, why support for IPv6 would break this... anyway, with:

shell stream tcp6 nowait root /usr/lbin/remshd remshd

on /etc/inetd.conf on BBBB, its now working fine.

Thanks

Jesus Couto F.
Jesús Couto Fandiño
Occasional Advisor

Re: remsh not working with command.

entry for shell service in /etc/inetd.conf has to have tcp6 as the protocol; using tcp was making this problem appear.