Rlogin To Unix Without Password

How can you login to a UNIX account without password? 

It's possible to rlogin from one host to another host without a PASSWORD. (It's a bit confusing)

On the host you want to rlogin just create a ./rhosts file in the user's home directory to whom you want to rlogin and in that .rhosts file you specify the ip address or the hostname of the machine from where you want to rlogin and the username from where you want to run rlogin.  For e.g user "me" on host A wants to rlogin to user "you" on host B without a password. Then user "you" on host B should create a .rhosts file in his/her home directory with the hostname and username entry i.e A me.

For more info refer the man rlogin or man rsh or man rcp or man rhosts

Example:

Every UNIX user logs into a user account by giving the username and password. There are situations when a user has to login to a particular account many times during the day. It would have been easier had the user not been asked to provide the password every time he tried to log-in.

There are many ways in which a user can login to an account without password. In this article, we are going to see how to use the rlogin command to achieve this.

The basic use of rlogin command is to do a remote login. Though the name tells 'remote login',the rlogin command can be used to login  to a user account of the same machine or a different machine.

Using rlogin to login to a user account in different box:

Let us consider a scenario. A user 'gpr' in UNIX box 'SandalWood' tries to login to the user 'blogger' in UNIX box 'TeakWood'.

1. In the home directory of the user 'blogger' in 'TeakWood', create a file .rhosts if not present and add the following contents to it.

#cat $HOME/.rhosts

SandalWood gpr

2.  The user 'gpr' should now execute the rlogin command from 'SandalWood' box as shown below:

#rlogin TeakWood -l blogger

When  issuing the above rlogin command, the user will now be directly taken into the user account 'gpr' without being prompted for password.

Whenever the rlogin command is used, it first checks for .rhosts file in the destination user account's home directory. On finding the .rhosts file, it tries to find the entry for the remote user being logged. If a valid entry exists, the user gets considered as a trusted user and hence not prompted for password.

Using rlogin to login to a user account in the same box:

If the rlogin command is used to login to a user account of the same machine, the hostname need not be specified in the .rhosts file. In place of hostname, the symbol '+' can also be used as shown in the below example: 

#hostname 

TeakWood

#echo $USER

gpr

#cat $HOME/.rhosts

+  blogger

The above entry in the .rhosts file will allow the blogger user 'blogger' to login to the user account 'gpr' without password.

Unix Tips

See Also
Modify Etc Password File

Have a Unix Problem
Unix Forum - Do you have a UNIX Question?

Unix Books :-
UNIX Programming, Certification, System Administration, Performance Tuning Reference Books

Return to : - Unix System Administration Hints and Tips

(c) www.gotothings.com All material on this site is Copyright.
Every effort is made to ensure the content integrity.  Information used on this site is at your own risk.
All product names are trademarks of their respective companies.
The site www.gotothings.com is in no way affiliated with or endorsed by any company listed at this site.
Any unauthorised copying or mirroring is prohibited.