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$

Enable rsh on MAC OS with command line的更多相关文章

  1. 0821找不到Command Line Utility的解决方案

    在Object-C基础教程中写到,要求选择Xcode中Mac OS X - Command Line Utility - Foundation Tool 但在Xcode4.5中Mac OS X中没有C ...

  2. Installing Apache, PHP, and MySQL on Mac OS X

    I have installed Apache, PHP, and MySQL on Mac OS X since Leopard. Each time doing so by hand. Each ...

  3. 8个不可不知的Mac OS X专用命令行工具【转】

    OS X的终端下通用很多Unix的工具和脚本.如果从Linux迁移到OS X会发现很多熟悉的命令和脚本工具,其实并没有任何区别. 但是OS X也提供了很多其他系统所没有的特别的命令行工具.我们推荐8个 ...

  4. 转:值得收藏!那些鲜为人知的 Mac OS X 技巧

    看到一篇网友整理的比较好的“那些鲜为人知的 Mac OS X 技巧”,转载过来分享给大家!希望能有帮助. 更多专题,可关注小编[磨人的小妖精],查看我的文章,也可上[风云社区 SCOEE],查找和下载 ...

  5. Mac OS X 命令行用户应当知道的八个终端工具

    原文链接:Eight Terminal Utilities Every OS X Command Line User Should Know OS X  的Terminal 终端开辟了强大的UNIX实 ...

  6. Linux/Mac OS 个人常用Terminal技巧整理

    刚开始接触linux有些不适应,走了不少弯路,一直没有系统的学过linux应用,基本都是零零散散Google出来的知识,在这里做个整理: Vi/Vim 基本操作: 刚开始接触linux时,不懂vi吃了 ...

  7. 在Mac OS终端的Terminal 中使用Sublime Text3

    查看环境变量: $ echo $PATH $ /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin 创建软链接: $ sudo ln -s /Application ...

  8. Xcode Command Line Tools for Mac OS X 10.9 Mavericks

    by Daniel Kehoe Last updated 28 December 2013 How to install Apple Xcode Command Line Tools for Mac ...

  9. MAC OS 如何安装命令行工具:Command Line Tools

    打开终端输入:xcode-select --install 回车 安装好了测试结果:gcc -v 显示如下: xcode-select: note: install requested for com ...

随机推荐

  1. lua实现私有函数

    本文是原创文章,如需转载,请注明文章出处 要用lua实现私有函数,关键就是使用metatable的特性来实现. Test.lua: local v = {};v.x = 100;v.y = 200; ...

  2. JQuery validate.js 在ajax提交form时如何触发

    在使用jquery validate.js 插件时,发现,如果是用onclick事件捕获提交按钮的动作,并且ajax动态提交form,验证不会被触发,而是直接提交了form. 后来发现,需要手动调用该 ...

  3. 使用dreamweaver去掉文本中的空格和换行

    当我们从其他地方拷贝文本到网页,在html代码中会自动带有空格和换行,手动去掉很麻烦,今天试着用dreamweaver去了一下,方法如下: 1.点击Ctrl+F,打开“查找和替换”窗口 2‘见下图:

  4. spring与mybatis三种整合方法

    spring与mybatis三种整合方法 本文主要介绍Spring与Mybatis三种常用整合方法,需要的整合架包是mybatis-spring.jar,可通过链接 http://code.googl ...

  5. phonegap + xcode5.0.2 配置开发环境

    phonegap官网:  http://phonegap.com/ 第一部:安装nodejs 安装地址:http://nodejs.org/ 安装phoneGap 官网下载http://phonega ...

  6. STEP模块——电子琴

    电子琴原理 什么是声音?上过初中的朋友都知道声音是由震动所产生的.一定频率的震动就产生了一定频率的声音. 理论研究第一步,让喇叭发出do re mi fa sol la si的音,我们先不管do的频率 ...

  7. Dependency Scope

    Dependency Scope <dependency>中还引入了<scope>,它主要管理依赖的部署.目前<scope>可以使用5个值: * compile,缺 ...

  8. 1745. Yet Another Answer

    http://acm.timus.ru/problem.aspx?space=1&num=1745 题目大意: 可以是任意的顺序,在满足括号匹配的情况下,求组合成的字符串长度最长 思路: 先将 ...

  9. C# 中 多线程同步退出方案 CancellationTokenSource

    C# 中提供多线程同步退出机制,详参对象: CancellationTokenSource CancellationTokenSource 中暂未提供复位操作,因此当调用Cancle 之后,若再次调用 ...

  10. SpringMVC与MyBatis整合(一)——查询人员列表

    从今天开始,一点点的记录做毕设和学习的过程. 寒假才开始接触SpringMVC和MyBatis,之前对框架的概念理解并不到位,也没学过Spring.目前学习起来思路并不很清晰,有些东西我还不能理解,只 ...