2

I have two machines running Solaris 9 (192.168.2.9) and Windows XP (192.168.2.5). I need to run the following command on the Windows machine:

rsh 192.168.2.9 -l root pwd

To be able to run this command I've created the /etc/hosts.equiv file on the UNIX machine, which contains:

192.168.2.5 xp.user

where xp.user is the name of the active XP account, under which the rsh command connects.

The command gives the following messages:

192.168.2.9: permission denied
rsh: can't establish connection

I tried to change the UNIX user to notroot:

rsh 192.168.2.9 -l notroot pwd

The command gave the same result:

192.168.2.9: permission denied
rsh: can't establish connection

But when I created the file /home/notroot/.rhosts with the same contents as /etc/hosts.equiv the result was OK:

/home/notroot

Both the hosts.equiv and .rhosts files are identical and were created in the UNIX vi editor. The empty lines are added at the end of each file. The properties of the files are:

/etc/hosts.equiv - group: root; owner: root; permissions: owner: RW

/home/notroot/.rhosts - group: other; owner: notroot; permissions: owner: RW

The choice of rsh protocol and the root account doesn't depend on me.

So, how can I run the rsh command under the root account?

Snowjay
  • 35
  • 1
  • 5
  • Have you tries putting the mentioned `.rhosts` under ~root? – peterph Apr 02 '13 at 14:52
  • I have no such directory. – Snowjay Apr 03 '13 at 09:56
  • you root user doesn't have a home directory (which is what the tilda stands for - ~userxyz/ is home directory of userxyz)? – peterph Apr 03 '13 at 10:08
  • Yes, it works! In my system the home directory for root is "/" (which is the default, AFAIK), so I placed .rhosts there. But I also had to change the permissions of the file to 'group: root; owner: root; permissions: owner: RW'. With its original permissions (group: other; owner: notroot; permissions: owner: RW) it didn't work. Thank you for the advice! – Snowjay Apr 03 '13 at 12:56
  • `/` is **not** the default home directory for root, and should never be set so! The usual location of root's `$HOME` is `/root`. – peterph Apr 04 '13 at 22:34
  • Yes, I absolutely agree that the root's home directory should be set to /root. But many sites and tutorials clearly state that the Solaris' root home directory is '/', and some of them also give instructions how to change it to /root (no need to mention them, just google). Besides, I've checked several servers running Solaris 9, and none of them has the /root directory. I think it's very doubtful that the admins who set them up changed /root to '/' after or during installation. Doesn't that mean the default location? – Snowjay Apr 05 '13 at 12:49
  • Interesting, IMHO the tutorials are flawed - mixing root's configuration with system data is just asking for troubles (the next step being: *remove all directories, just store everything in `/`*). – peterph Apr 05 '13 at 14:10
  • Hmm... I'll put it another way: the tutorials just say that '/' is the **default** location, not the **right** one. And some of them suggest how to improve the situation by changing it to /root, exactly as you said.))) – Snowjay Apr 05 '13 at 18:16
  • Oh ok, I misread your comment. – peterph Apr 05 '13 at 19:34

1 Answers1

1

Workaround is placing the .rhosts file into root's home directory (see comments under the question).

peterph
  • 30,520
  • 2
  • 69
  • 75