rsh (用于远端登入的Shell)

rose1 发表于 2020-07-24 16:09
浏览次数:
在手机上阅读

在类似Unix的操作系统,rsh命令执行用于远端登录的Shell

查看英文版

目录

1 rsh 运行系统环境

2 rsh 说明

3 rsh 语法

4 rsh 例子

rsh 运行系统环境

Linux

rsh 说明

rsh连接到指定的主机,并执行指定的命令。rsh将其标准输入复制到远程命令,将远程命令的标准输出复制到其标准输出,并将远程命令的标准错误复制到其标准错误。中断,退出和终止信号传播到远程命令;rsh通常在远程命令执行时终止。

单个用户可以在其(远程)主目录中的.k5login文件中保留私有授权列表。该文件中的每一行都应包含Kerberos主体名称,形式为principal / instance @ realm。如果存在〜/ .k5login文件,则且仅当发起者用户已通过〜/ .k5login文件中指定的主体之一进行身份验证时,才授予该帐户访问权限。

rsh connects to the specified host, and executes the specified command. rsh copies its standard input to the remote command, the standard output of the remote command to its standard output, and the standard error of the remote command to its standard error. Interrupt, quit and terminate signals are propagated to the remote command; rsh normally terminates when the remote command does.

Individual users can keep a private authorization list in a file named .k5login in their (remote) home directory. Each line in this file should contain a Kerberos principal name of the form principal/instance@realm. If there is a ~/.k5login file, access is granted to the account if and only if the originator user is authenticated to one of the principals named in the ~/.k5login file.

查看英文版

查看中文版

rsh 语法

rsh host [-l username] [-n] [-d] [-k realm] [-f | -F] [-x] [-PN | -PO] command

选件

-l username 将远程用户名设置为username。否则,远程用户名将与本地用户名相同。
-x 使网络会话流量被加密。这仅适用于输入和输出流,不适用于命令行。
-f 使不可转发的Kerberos凭据转发到远程计算机,以供指定命令使用。命令完成后,它们将被删除。此选项与-F选项互斥。
-F 导致将可转发的Kerberos凭据转发到远程计算机,以供指定的命令使用。命令完成后,它们将被删除。此选项与-f选项互斥。
-k realm 使rsh获取领域中的远程主机的票证,而不是krb_real-mofhost确定的远程主机的领域的票证。
-d 在用于与远程主机进行通信的TCP套接字上打开套接字调试。
-n / dev / null重定向输入。
-PN-PO 明确请求Kerberos“ rcmd ” 协议的新版本或旧版本。新协议避免了旧协议中存在的许多安全问题,但不能与旧服务器互操作。(“输入/输出错误”和关闭的连接是尝试此组合的最可能结果。)如果未指定任何选项,则使用一些简单的试探法来猜测尝试哪种方法。

如果您省略命令,则将执行rlogin登录到远程主机,而不是执行单个命令。


未引用的Shell 元字符在本地计算机上解释,而引用的元字符在远程计算机上解释。例如,以下命令:

rsh otherhost cat remotefile >> localfile

将远程文件remotefile 追加到本地文件localfile,同时:

rsh otherhost cat remotefile ">>" otherremotefile

remotefile附加到otherremotefile

请注意,交互式命令(例如文本编辑器)无法使用rsh远程执行;请改用rlogin

档案

/etc/hosts 该主机名映射定义文件。
~/.k5login 在远程主机上,此文件可用于定义允许访问的Kerberos主体。
rsh host [-l username] [-n] [-d] [-k realm] [-f | -F] [-x] [-PN | -PO] command

Options

-l username Sets the remote username to username. Otherwise, the remote username will be the same as the local username.
-x Causes the network session traffic to be encrypted. This applies only to the input and output streams, and not the command line.
-f Cause nonforwardable Kerberos credentials to be forwarded to the remote machine for use by the specified command. They will be removed when command finishes. This option is mutually exclusive with the -F option.
-F Cause forwardable Kerberos credentials to be forwarded to the remote machine for use by the specified command. They will be removed when command finishes. This option is mutually exclusive with the -f option.
-k realm Causes rsh to obtain tickets for the remote host in realm instead of the remote host's realm, as determined by krb_real-mofhost.
-d Turns on socket debugging on the TCP sockets used for communication with the remote host.
-n Redirects input from /dev/null.
-PN-PO Explicitly request new or old version of the Kerberos "rcmd" protocol. The new protocol avoids many security problems found in the old one, but is not interoperable with older servers. (An "input/output error" and a closed connection is the most likely result of attempting this combination.) If neither option is specified, some simple heuristics are used to guess which to try.

If you omit command, then instead of executing a single command, you will be logged in on the remote host using rlogin.

Shell metacharacters that are not quoted are interpreted on the local machine, while quoted metacharacters are interpreted on the remote machine. For example, the following command:

rsh otherhost cat remotefile >> localfile

appends the remote file remotefile to the local file localfile, while:

rsh otherhost cat remotefile ">>" otherremotefile

appends remotefile to otherremotefile.

Please note that interactive commands, such as a text editor, cannot be executed remotely with rsh; use rlogin instead.

Files

/etc/hosts The hostname map definitions file.
~/.k5login On the remote host, this file may be used to define the Kerberos principals that are allowed access.

查看英文版

查看中文版

rsh 例子

rsh example-host.com ls

使用本地用户名作为远程登录名,在主机example-host.com上执行ls命令。

rsh example-host.com ls

使用本地用户名作为远程登录名,在主机example-host.com执行ls命令

查看英文版

查看中文版

其他命令行

renice | replace | rm | rmdir | rn | route | rpcinfo | rename | rcp | readlink | rehash | rlogin | rmmod |

如此好文,分享给朋友
发表评论
验证码:
评论列表
共0条