When I run
ravbholua@ravbholua-Aspire-5315:~$ rlogin 109.202.101.166
it promps me for password as below:
ravbholua@ravbholua-Aspire-5315:~$ rlogin 109.202.101.166
ravbholua@109.202.101.166's password:
To make password free access, I created a file /etc/hosts.equiv
in the remote machine (ravi.com) as below:
root@ravi:/etc# cat hosts.equiv
localhost
42.110.54.211
root@ravi:/etc#
But still whenever I run the above command to login to this remote
machine, it asks for password.
Additionally, I also created .rhosts file in my same like-to-like account
in remote machine in home dir. as below:
ravbholua@ravi:~$ cat .rhosts
localhost
42.110.54.211
ravbholua@ravi:~$
What may be the problem that I am not able to have password-free access.
One important point to be noted:
To know what's my internet IP address is, I got from the below two sites (both gave the same IP address)
http://www.ipchicken.com/
http://whatismyip.org/
You may please refer to the below link where I had asked for the same query but
couldn't get resolved.
not-able-to-do-password-free-access-to-remote-machine
Edit: I ran:
ravbholua@ravbholua-Aspire-5315:~$ sudo scp ~/.ssh/id_rsa.pub rs:.ssh/authorized_keys
as without sudo, it messaged:permission denied. Then I tried both
sudo ssh rs
and
ssh rs
Still I was prompted for password. I entered my remote server after entering password and found the file that was transferred in /root/.ssh as shown ahead.
root@ravi:~/.ssh# ls
authorized_keys known_hosts
root@ravi:~/.ssh#
Please note rs is an alias for my remote server.
Best Answer
You can also use ssh to configure password-less login to a remote computer.
It is just (on computer a):
That's it.
Now you can do a
without having to enter a password.
You can optionally configure things like:
ssh alias
Unless you can't use ssh, it seems to be much more convenient to setup than rlogin.
Plus, ssh protects you against main-in-the-middle attacks and eavesdropping.
Troubleshooting
Make sure that the
~/.ssh
has the right permissions (on both systems) - i.e. is only accessible by your user - otherwise ssh ignores it. That means onlyrwx------
for the directory andrw-------
for the files. Usels -l
andls -ld
to verify this.Make sure that the remote
~/.ssh/authorized_keys
contains the correct public key. Verify via:If the setup does not work like this, perhaps you have to explicitly configure the client side, i.e. adding something like this to
.ssh/config
:For diagnosing issues it is also useful to add
-v
tossh
call, e.g.: