Wednesday, August 13, 2008

.rhosts and /etc/hosts.equiv

aarklon

can any one give an example for configuring .rhosts file so that i can allow some trusted computers in my LAN to access my ubuntu 8.04 machine via telnet,ssh without having to enter password. BTW there is no /etc/hosts.equiv file in my machine, so will i have to create it ...????


bit twister

Easy enough, FQDN space user name per line or ip_addy user name.

$ cat ~/.rhosts
wb.home.invalid bittwister

Be sure to chmod 600 ~/.rhosts


antonio batovanja

man ssh-keygen
man ssh-copy-id


unruh

It is a bad idea to use telnet. Too many systems have had passwords stolen.That the remote computers (or local computers) are trusted is irrelevant.You also have to trust every inch of lan as well.On ssh, use the authorized-key mechanism. Place the contents of .ssh/id_rsa/pub into the other computer's .ssh/authorized_keys file to allow you to log onto their system without a password. That replaces teh notion of .rhosts or /etc/hosts.equiv

>BTW there is no /etc/hosts.equiv file in my machine, so will i have to
>create it ...????

Yes, you would have to create it if instead of listening to everyone you decided to go that route.

kcarun

I am preparing for SUN certification. In my text book in review section there is a question,

Q)Which of the following files gives a specified user permission to log in remotely from the specified host without having to supply a password?

a) .rhosts
b) /etc/hosts.equiv
c) /etc/default/login
d)/etc/hosts

1) Answer is shown as option 'a' , But 'b' is also correct?
2) these 2 files are using for same purpose ?


jrtayloriv

/etc/hosts.equiv is system-wide and applies to everyone, while .rhosts is specific to the user (and is stored in their home directory).since it says "specified user" -- the answer is (a).


javier

.rhosts can be edited by either root or a regular user in their own home directories. /etc/hosts.equiv can only be edited for root but it applies to users only.

Examples:

root on server1 wants to allow root on server2 to log into server1 as root

echo server2 >> /.rhosts

root on server1 wants root from anywhere to log in as root from any other machine (really stupid)

echo + >> /.rhosts

root on server1 wants paul to log in as root from server2 (with the -l option)

echo server2 paul >> /.rhosts

root on server1 wants to allow john and paul to log in as themselves (basically any users that exist on both machines but not root) from server2 into server1

echo server2 >> /etc/hosts.equiv

john on server1 wants john to log in as himself from server2

echo server2 >> /export/home/john/.rhosts

john on server1 wants paul to log in as john from server2

echo server2 paul >> /export/home/john/.rhosts

Well, you get the idea (I hope)

No comments:

Post a Comment