What is needed to allow a rsh command to run without a password

I need to be able to rsh within a script without having to enter a password. Right now I am getting permission denied. What must be changed to allow this. I know it can be done since one network system allows this and one does not. The System Admininstrators do not know what to do.
andrewmchorneyAsked:
Who is Participating?
 
Billp022500Connect With a Mentor Commented:
Add users login name to the .rhosts file under / on the unix box.
This isn't verry secure, but it works..
0
 
Billp022500Commented:
Are you runing NIS on the unix box?
0
 
andrewmchorneyAuthor Commented:
We are working in a closed network.

Say I am on machine a and in the script I have

rsh b ls

Do I edit the .rhosts file in / on machine a or b.
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
Billp022500Commented:
set a login and password on machine b
add a, add the login name to the .rhosts file on machine b. This will allow you to rsh without a password.

0
 
andrewmchorneyAuthor Commented:
Bill

On the one network where I can do a rsh host ls without a password, there are no user login names in the .rhosts file. In fact the .rhosts file has only hostnames in it. What else can cause a permission denied.

I do have accounts on both machines.
0
 
Billp022500Commented:
try and create a user on box a. like "test" assign the password and login as test.  Now login to "B" create the same user "test". Do the password thing..
Once you are able to login as test, add the user to the .rhosts file on machine b. I have tested it here.. It works..
0
 
andrewmchorneyAuthor Commented:
Bill

On the one network where I can do a rsh host ls without a password, there are no user login names in the .rhosts file. In fact the .rhosts file has only hostnames in it. What else can cause a permission denied.

I do have accounts on both machines.
0
 
Billp022500Commented:
is the hostname of box a in the .rhosts file of box b?
0
 
mliberiCommented:
rshd (the program rsh and rlogin connects with) search /etc/hosts.equiv file, if user is not root, and than $HOME/.rhosts file (that must be 600).

each line /etc/hosts.equiv and ~/.rhosts contains one of the following:

+      (a single plus)
any user from any host is allowed to log in

+ username
username from any host is allowed to log in

hostname
any user from hostname is allowed to log in

hostname username
username from hostname is allowed to log in

SO:
1) create a .rhosts file in the home directory of the user you want to use on node b

2) add one of the above authentication modes to it

3) chmod 600 .rhosts
file must not be readable from any other
user

hint:
if you put a '+' in /etc/hosts.equiv file any non root user can execute commands and log in your system without giving a password. The only restriction is that the host the request is coming from must be known.
0
All Courses

From novice to tech pro — start learning today.