Enable rsh on MAC OS with command line

1. Enable rsh on macos.

   1). os version (10.0)

     Enabling the "Allow remote login" option turns on telnet, rlogin (remote login), and rsh (remote shell) services. You can then connect remotely to your computer by using a client application for any of these services.

  2) Mac OS X versions 10.0.1 to 10.1 and later

   Enabling telnet, rlogin, and rsh in Mac OS X 10.0.1 and later

Important: Telnet, rlogin, and rsh send information (including passwords) over the network unencrypted. OpenSSH provides greater security. You should only revert to telnet, rlogin, and rsh if your network environment requires them.
You must be logged in as an Admin user to follow these steps. After each step in which you type a command, press the Return key.

1. Open the Terminal utility.
2. Type sudo pico /etc/inetd.conf
3. Type in your admin password.
4. Press Return.
5. The file inetd.conf will open in the pico text editor. Using the arrow keys to navigate, scroll down until you see the lines for:
#telnet
#shell
#login
6. Remove the pound "#" character from the line of each service you want to re-enable.
7. Save the file (press Control-O), press Return, and exit pico (press Control-X).
8. Choose Restart from the Apple menu.

When the computer has restarted, the services you enabled should be available.

3) if above doesn't work

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

(note: currectly shell.plist and login.plist were in binary type, you couldn't edit them directly, This can only be edited by Lingon, if you didn't installl Lingon, you can transfer them to xml format via plutil -convert xml1 file.plist , then edit the xml file)
- 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$

转载于:https://www.cnblogs.com/spandon/p/3818598.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值