How to setup RSH on Mac OS X?

I need to use rsh to execute a command on a remote Mac. I know SSH is available but I need to use RSH. I already created a ~/.rhosts file and edited the /etc/hosts.equiv file. The Firewall has all ports open.

Every time a run "rsh [host] [command]" I get a connection refused message.

I can't find any good information related to Mac OS X and RSH on the web. HELP! HELP!

MacPro, Mac OS X (10.5.1)

Posted on Jan 7, 2008 12:00 PM

Reply
4 replies

Jan 8, 2008 1:45 PM in response to Rick Van Vliet

I'm using Mac OS 10.4.11. I found out that the rshd is not running (ps -aux | grep rshd*) . I tried editing the inetd.conf and the xinetd.conf to enable the service with no luck. I tried using the command "service shell start" (the shell service starts rshd as defined in xinetd.conf), the command seems to work ok but I still can't connect from another computer.

I was reading about using launchd to start a service, I have no idea how to use launchd. I'll be reading for a while 😟.

Jan 8, 2008 9:00 PM in response to xgridfan

Funnily enough, I was trying to get this exact thing working today. The trick it seems, is that you need to have both rshd and rlogind running. Here's a step by step which will allow you to get root to rsh into localhost from localhost. Expanding this should be easy enough with a little reading. Refer to the rsh, rlogin, rcmd and .rhosts manual pages. Good luck.

- download Lingon from sourceforge
- fire it up and open the "shell" plist from the System Daemons list.
- check the enable checkbox
- save the plist
- open the "login" plist from the System Daemons list.
- check the enable checkbox
- save the plist
- open a terminal window
- run $ sudo launchctl load /System/Library/LaunchDaemons/shell.plist
- run $ sudo launchctl load /System/Library/LaunchDaemons/login.plist
- run $ sudo launchctl list | egrep "rsh|login"
- you will see something like this when they are loaded:

$ sudo launchctl list | egrep "rsh|login" -     0     com.apple.rlogind -     0     com.apple.rshd $


- run $ sudo launchctl start com.apple.rshd
- run $ sudo launchctl start com.apple.rlogind
- run $ sudo launchctl list | egrep "rsh|rlogin"
- you will see something like this when it's started (loading and starting are two separate things. If you load but don't start, it won't work. You'll know when they are started, because the number in the first column will NOT be zero if the processes are properly started. 0 means they are loaded, >0 means they are started):

$ sudo launchctl list | egrep "rsh|login" 608     -     com.apple.rlogind 604     -     com.apple.rshd $


- run sudo su (don't ask me why, but you cannot sudo the below command, you have to be su to run it, hence the sudo su).
- run 'echo "localhost root" >> /etc/hosts.equiv'
- run rsh localhost - and voila:

$ rsh localhost
Last login: Tue Jan 8 23:21:04 on ttys000
bash$

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How to setup RSH on Mac OS X?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.