Automatic rsh login to BSD Box

Garrett Cooper youshi10 at u.washington.edu
Thu Feb 15 06:02:59 UTC 2007


Ashok TM wrote:
> Hi
> 
> I have 2 BSD boxes, want to acheive automatic rsh  login from one BSD 
> box to
> other.
> I tried placing host name of the  boxes in .rhosts file  of the boxes under
> ~root  directory.
> This works fine with user account and  I am able to  remotely execute
> commands on the other box with rsh.
> 
> Eg:
> ==
> rsh  bsd2 df
> bsd2 - host
> df - command
> 
> But with super user account , i get error as
> rshd: Login incorrect.   which basically is * Login incorrect.*   No
> password file entry for the user name existed or the authentication
> procedure described above failed.Though i have password file entry of root
> in each of the BSD boxes
> 
> 
> ~atm

You know you can do this with SSH and host keys, right? It's a more 
secure than doing stuff via rsh.

Just do the following:

1. Uncomment "PermitRootLogin without-password" in /etc/ssh/sshd_config.
2. As root run ssh-keygen, pick your cypher and password, and then put 
it in .ssh/authorized_keys on the remote host.
3. Restart the serving host's sshd using /etc/rc.d/sshd restart.

Voila. Much better than using rsh.

(I admit I skipped or glossed over a few steps, but if you want more 
information they're available in the manpages :)..).

-Garrett


More information about the freebsd-questions mailing list