Technical article 107582

rcmd/rsh fails with "Permission denied" or rlogin requires a password.

OpenServer 6.0.0OpenServer 5UnixWare 7.1.3UnixWare 7.1.4

Written · Last revised

Problem

After setting up user equivalence between two systems, rcmd fails with "Permission denied", rlogin requires a password, or rcp fails with "Login incorrect".

Cause

1. The form of the remote host name in the .rhosts or /etc/hosts.equiv line doesn't exactly match the form returned by the gethostbyaddr(SLIB) system call.

-OR-

gethostbyaddr fails because there is no PTR (reverse) record for the remote system in the DNS nameserver.

2. Permissions on the .rhost file allow writing by group or other.

3. The "trusted" host is listed in /etc/net.deny or
/etc/service.deny.  Note: This only applies to TCP/IP 1.2.1
and earlier.  The usage of these files is documented in the
net_access(NF) man page (net<underscore>access).

Solution

Take these steps to check if you have one of the above problems:

1. Add all forms of the remote host name to the .rhosts or /etc/hosts.equiv file (example):

client.sco.com user
client user
123.174.106.18 user

Normally, check the /etc/hosts file, if the form is in:

123.174.106.18 client client.fqdn

then the entry in .rhosts should read:

client root
(See "Additional troubleshooting information" below.)

2. Make .rhosts read/write for the owner only:

# chmod 600 .rhosts

It is required that .rhosts be writable by the owner only.

When you open an editor to create /.rhosts, it will probably have 644 permissions, so "chmod 600 /.rhosts" will be necessary.

It is strongly recommended that both .rhosts and /etc/hosts.equiv be readable and writable by the owner only.

.rhosts files may be owned by root.  This can be used
to prevent users from setting up their own .rhosts files.

3. Check for and remove any offending entries for the trusted host in /etc/net.deny and /etc/service.deny.

4. Can you "rcmd" to the same server or "localhost"?

Additional troubleshooting information:
--------------------------------------
rshd(ADMN) performs a gethostbyaddr(SLIB) system call using the IP
address of the connecting host and then compares the host name returned
by gethostbyaddr to the .rhosts or /etc/hosts.equiv host entry.  An exact
match is required.

If gethostbyaddr fails, it looks for the IP number in .rhosts or /etc/hosts.equiv.

If you are using /etc/hosts, you can determine the required form of the host name by referencing the second field of the /etc/hosts file.

If you telnet into the server from the trusted host, then netstat will
also show the required form.  This is a very good test.
Here are some examples from a scenario where the user "user" on
client.sco.COM is trusted to log into server.uss.sco.COM.  The host name
form is highlighted with "^^^"s:
------------------------------------------------------------------------------
/etc/hosts entry (on server):
----------------------------
123.174.106.18  client.sco.COM client
                ^^^^^^^^^^^^^^
netstat output (after telnet into server from client):
-----------------------------------------------------
Active Internet connections (including servers)
Proto Recv-Q Send-Q  Local Address          Foreign Address        (state)
tcp        0      0  server.telnet          client.sco.COM.4073    ESTABLISHED
tcp        0      0  server.1189            client.sco.COM.telnet  ESTABLISHED
                                            ^^^^^^^^^^^^^^
required /.rhosts entry (on server):
-----------------------------------
client.sco.COM user
^^^^^^^^^^^^^^
------------------------------------------------------------------------------
/etc/hosts entry (on server):
----------------------------
123.174.106.18  client client.sco.COM
                ^^^^^^
netstat output (after telnet into server from client):
-----------------------------------------------------
Active Internet connections (including servers)
Proto Recv-Q Send-Q  Local Address          Foreign Address        (state)
tcp        0      0  server.telnet          client.4104            ESTABLISHED
tcp        0      0  server.1141            client.telnet          ESTABLISHED
                                            ^^^^^^
required /.rhosts entry (on server):
-----------------------------------
client user
^^^^^^
------------------------------------------------------------------------------
/etc/hosts entry (on server):
----------------------------
# 123.174.106.18  client.sco.COM client
netstat output (after telnet into server from client):
-----------------------------------------------------
Active Internet connections (including servers)
Proto Recv-Q Send-Q  Local Address          Foreign Address        (state)
tcp        0      0  server.telnet          123.174.106.18.4189    ESTABLISHED
tcp        0      0  server.1141            123.174.106.18.telnet  ESTABLISHED
required /.rhosts entry (on server):
-----------------------------------
123.174.106.18 user
------------------------------------------------------------------------------
Finally, if you are using nameservice, then use nslookup to determine the
required form of the host name and/or verify that a PTR (reverse) record
is set up for the remote host.  (The PTR records map IP addresses to host
names.  They are called "reverse" records because they are the reverse of
the more familiar A records, which map host names to IP addresses.)  "^^^"s
indicate entries typed by the user:
# nslookup
  ^^^^^^^^
Default Server:  nameserver.uss.sco.COM
Address:  123.174.144.241
> client
  ^^^^^^ enter host name
Server:  nameserver.uss.sco.COM
Address:  123.174.144.241
Name:    client.sco.com
Address:  123.174.106.18
> set type=PTR
  ^^^^^^^^^^^^ search for PTR (reverse) records
> 123.174.106.18
  ^^^^^^^^^^^^^^ enter the IP address of the remote host
Server:  nameserver.uss.sco.COM
Address:  123.174.144.241
18.106.174.123.in-addr.arpa     name = client.sco.COM

name = client.sco.COM indicates that a PTR record exists, and client.sco.COM is the form of the host name required in .rhosts.

Alternatively, add "hostresorder local bind" to /etc/resolv.conf and ensure that the name is entered correctly into the /etc/hosts file.

NOTES:    For root equivalency you must use the /.rhosts file, as
          hosts.equiv does not work for the root account.

This article also applies when the .rhosts file is NFS mounted.

See also

TA107735, "How to set up user equivalence between two systems."

TA107573, "User equivalency does not function - password is still required."

From the Xinuos technical article database, record 107582. Reproduced with permission. The original is at www.sco.com/ta/107582, which is reachable but blocked from search engines.

Next step

Need this fixed rather than explained?

Tell us the release, what the system runs and what it is doing. We will reply by email with what we would do next.

  • You deal with the people who do the work
  • No obligation, and no upgrade required before we will help
  • We tell you plainly if something is not worth doing

Send an enquiry

We reply by email. If a server is down, say so in the first line. You can also write to help@scoexpert.com.