Go to main content

手册页部分 8:系统管理命令

退出打印视图

更新时间: 2022年7月27日 星期三
 
 

rad(8)

名称

rad - 远程管理守护进程

用法概要

/usr/lib/rad [-d] [-s] [-S fmri]
     [-M module [ -M module ]...]
     [-m moduledir [ -m moduledir ]...]
     [-t transpec [ -t transpec ]...]
     [-e timeout]

描述

rad 这一工具能够采用各种高级语言以一种安全方式向使用者展示编程系统管理和监视接口。

可通过以下方式使用 rad

  • 作为服务:

    作为服务运行时,rad 使用 getpeerucred(3C)pam(3PAM) 验证连接。以此方式使用该工具时,占用的 API 以通过验证的用户身份运行。提供此操作模式时考虑了期望能够单独执行特权操作的本地使用者和远程使用者。

  • 作为非特权程序:

    作为非特权程序运行时,rad 仅充当其客户机与其发布的管理 API 之间的桥梁。以此方式使用时,占用的所有接口将使用 rad 进程持有的权限运行。

rad 是模块化工具。rad 发布的 API 同 rad 所识别的协议及其可进行通信的传输一样是作为共享对象进行交付的。rad 的多个实例可同时运行,每个实例运行时都相互独立,为不同的使用者提供不同的服务,在不同的端口或接口上侦听不同类型的连接。rad 从其命令行选项和/或 smf(7) 中获取其配置。

选项

以下选项可在命令行上使用:

–d

发出详细调试输出。

–e timeout

指定连接超时(以秒为单位)。缺省值为 180 秒。

–m moduledir

moduledir 添加到要从中扫描和装入模块的目录列表。–m 选项可多次使用来添加多个模块目录。

–M module

module 添加到要装入的模块列表。module 应该是绝对路径名或当前工作目录的相对路径名。使用 –M 装入的模块优先于使用 –m 找到的模块。–M 选项可多次使用来添加多个模块。

–t transpec

实例化传输规范 transpec 指定的传输。传输规范采用以下格式:

transport[:option[=value][,option2[=value2]]...]

Multi-value options like addr use pipe ('|') delimited values.

–s

svc.startd(8) 启动方法具有相同行为。此选项具有以下作用:

  • 如果不指定 –S 选项,rad 将从 scf_myname()(请参见 scf_handle_create(3SCF))标识的服务读取其配置。

  • rad 将使用 smf_method(7) 兼容的退出状态。

  • rad 将运行守护进程,仅当它可以处理请求时返回成功。

–S fmri

从 fmri 指定的 SMF 服务实例读取配置。如果不指定 –s 选项,就不会从该服务读取配置的传输,以避免端点与运行的服务发生冲突。

先搜索命令行中指定的模块目录,再搜索 SMF 中配置的模块目录,允许命令行配置覆盖 SMF 配置。

SMF 配置

radsmf 读取其配置时,它会从名为 config 且类型为 application 的属性组中读取一般配置,从类型为 xport_XYZ(其中 XYZ 会替换为传输类型的名称)的一系列属性组中读取任意数量的传输中每个传输的配置。通过为特定传输类型创建多个属性组可配置相应类型的多个实例。用于配置传输的属性组名称并不重要。

config 属性组包含以下属性:

moduledir

字符串列表。从中扫描和装入模块的目录。

modules

字符串列表。要装入的特定模块的文件名。

debug

布尔值。如果为 true,rad 将发出详细调试输出。缺省值为 false

timeout

整数。验证时等待客户机单个响应的最大时间(以秒为单位)。缺省值为 180

服务实例

配置 svc:/system/rad SMF 服务的两个实例以运行 /usr/lib/rad/rad

svc:/system/rad:local

rad 配置为通过以下位置的 AF_UNIX 套接字使用 unix 传输:

  • /system/volatile/rad/radsocket(适用于通过 getpeerucred(3C) 验证的连接)。

  • /system/volatile/rad/radsocket-unauth(适用于通过 pam(3PAM) 验证的连接)。

  • /system/volatile/rad/radsocket-http(适用于通过 getpeerucred(3C) 验证的连接)。

  • /system/volatile/rad/radsocket-unauth-http(适用于通过 pam(3PAM) 验证的连接)。

支持通过前两个套接字进行 Rad 协议交互,并支持通过后续两个套接字进行 HTTP 协议交互。

svc:/system/rad:remote

rad 配置为使用 tlsgss 传输。TLS 传输为 RAD RPC 协议 (12302) 和 RAD HTTP/JSON 协议 (6788) 提供端口。

每个服务在其 moduledir 设置中均配置为以下目录:

/usr/lib/rad/module

特定于内容的模块

/usr/lib/rad/transport

传输端口

/usr/lib/rad/protocol

协议模块

/usr/lib/rad/site-modules

特定于站点的模块

Protocols

对不同协议的支持是以模块形式提供的。缺省情况下提供适用于以下协议的模块:rad(RAD RPC 协议)和 rad-http (HTTP/JSON)。一个 rad 实例可以支持多个传输,每个传输分别通过 proto 选项指定其支持的协议。有关更多信息,请参见“传输”部分。

Transports

对不同传输类型的支持是以模块形式交付的。Modules for the following transports are supplied with the system: Pipes (pipe), Generic Security Services API (gss), TCP sockets (tcp), TLS sockets (tls), and UNIX-domain sockets (unix).每个传输类型都有一组唯一的配置属性。通过在 SMF 属性组定义属性或为 –t 命令行选项提供子选项可以为传输类型的实例配置选项。

gss 传输利用 GSS-API 协议保护客户机与服务器之间的通信。它在 TCP 套接字上侦听 GSS-API 连接。gss 传输具有以下选项:

proto

字符串。要与此传输实例一起使用的协议。缺省值为 rad

port

整数。侦听连接的端口。

localonly

布尔值。如果为 true,rad 将仅侦听本地计算机的连接。Defaults to true.

pam_service

字符串。验证时要使用的 pam 服务名称。Defaults to rad-gss.请参见下文的"使用 PAM 验证"部分。

addr

A list of one or multiple IP address(es) in a string form to bind to and listen on for connections.If not specified, RAD will listen on the port number on all addresses/interfaces.Hostnames can be specified too in which case they will be resolved first.

pipe 传输从特定文件描述符进行读写操作,就像某进程希望使用管道与子 rad 进程进行通信时所需的那样。管道传输具有以下选项:

proto

字符串。要与此传输实例一起使用的协议。缺省值为 rad

fd

整数。从中进行读写操作的文件描述符。

exit

布尔值。如果为 true,rad 在通信达到管道末端时退出。缺省值为 false

tcp 传输在 TCP 套接字上侦听明文连接。tcp 传输具有以下选项:

proto

字符串。要与此传输实例一起使用的协议。缺省值为 rad

port

整数。侦听连接的端口。

localonly

布尔值。如果为 true,rad 将仅侦听本地计算机的连接。Defaults to true.

pam_service

字符串。验证时要使用的 pam(3PAM) 服务名称。Defaults to rad-tcp.请参见下文的“使用 PAM 验证”部分。

addr

A list of one or multiple IP address(es) in a string form to bind to and listen on for connections.If not specified, RAD will listen on the port number on all addresses/interfaces.Hostnames can be specified too in which case they will be resolved first.

tls 传输在 TCP 套接字上侦听 TLS 连接。tls 传输具有以下选项:

proto

字符串。要与此传输实例一起使用的协议。缺省值为 rad

port

整数。侦听连接的端口。

certificate

字符串。要使用的 PEM 格式 x509 证书的位置。

privatekey

字符串。要使用的 PEM 格式私钥的位置。

allow_client_certificate

布尔值。Allow the clients to authentication using an x509 client certificate.Defaults to true.

The certificate must be signed by specific a CA, which defaults to the one specified by client_ca_path.If the certificate contains UID=logname in the Subject and a user with given logname exists, the RAD daemon will authenticate the connection to that user.

require_client_certificate

布尔值。Requires that all clients must authenticate using an x509 client certificate.Defaults to false.

map_host_certificate_to_root

布尔值。Allow mapping client x509 certificate to the root user?Defaults to false.

If the client x509 doesn't have an UID set in the Subject and this option is set to true, then the RAD daemon will check, by way of calling X509_check_host() OpenSSL function, that the network peer host is listed either in Subject CommonName or in Subject Alternative Name.If the check succeeds, the RAD daemon will authenticate the connection as the root user.

client_ca_path

字符串。Location of the PEM-formatted file with a CA certificate all client x509 certificates must be signed with.If not specified, defaults to certificate/ca/uri property value of the svc:/system/identity:cert SMF instance.

pam_service

字符串。验证时要使用的 pam(3PAM) 服务名称。Defaults to rad-tls.请参见下文的“使用 PAM 验证”部分。

addr

A list of one or multiple IP address(es) in a string form to bind to and listen on for connections.If not specified, RAD will listen on the port number on all addresses/interfaces.Hostnames can be specified too in which case they will be resolved first.

unix 传输在 AF_UNIX 套接字上侦听连接。unix 传输具有以下选项:

proto

字符串。要与此传输实例一起使用的协议。缺省值为 rad

path

字符串。要侦听的路径。

peercred

布尔值。如果为 true,rad 将尝试使用 getpeerucred(3C) 自动验证连接。Defaults to true.

pam_service

n astring.验证时要使用的 pam(3PAM) 服务名称。Defaults to rad-unix.请参见下文的“使用 PAM 验证”部分。

Authenticating with PAM

rad 作为服务运行且 getpeerucred(3C) 不适用于要使用的传输时,pam(3PAM) 用于验证连接。使用的 PAM 服务名称取决于传输:

rad-gss

借助 gss 传输连接时

rad-tls

借助 tls 传输连接时

rad-tcp

借助 tcp 传输连接时

rad-unix

借助 unix 传输连接(且 peercredfalse)时

rad

借助其他任何传输连接时

在极少数情况下,管理员可能需要基于传输覆盖使用的 PAM 服务名称。例如,两个 rad TLS 传输(一个侦听本地(更可信)网络,一个侦听远程(不太可信)网络)服务一个 rad 实例时,可能需要不同的 PAM 配置。

在这种情况下,管理员可以指定要用作传输配置属性的 PAM 服务的名称(请参见上文的“传输”部分)。

正如所有 PAM 服务一样,PAM 将首先在 /etc/pam.conf 中再在 /etc/pam.d/service 中查找与 rad 的 PAM 服务对应的条目。如果未找到任何条目,PAM 将在 /etc/pam.conf 中查找与 "other"(其他)服务对应的条目。如果未找到 "other"(其他)条目,PAM 最终将在 /etc/pam.d/other 中查找条目。

文件

/etc/certs/localhost/host.crt

远程 rad 实例 (svc:/system/rad:remote) 存储其证书的位置。此文件对所有用户都是可读的。

/etc/certs/localhost/host.key

远程 rad 实例 (svc:/system/rad:remote) 存储其私钥的位置。

/system/volatile/rad/radsocket

其中本地 rad 实例 (svc:/system/rad:local) 接受使用 getpeerucred(3C) 隐式验证的连接的 AF_UNIX 套接字。

/system/volatile/rad/radsocket-unauth

其中本地 rad 实例 (svc:/system/rad:local) 接受必须使用 pam(3PAM) 显式验证的连接的 AF_UNIX 套接字。

/system/volatile/rad/radsocket-http

其中本地 rad 实例 (svc:/sys- tem/rad:local) 接受使用 getpeerucred(3C) 隐式验证的 HTTP 协议 (rad-http) 连接的 AF_UNIX 套接字。

/system/volatile/rad/radsocket-unauth-http

其中本地 rad 实例 (svc:/sys- tem/rad:local) 接受必须使用 pam(3PAM) 显式验证的 HTTP 协议 (rad-http) 连接的 AF_UNIX 套接字。

属性

有关下列属性的说明,请参见 attributes(7)

属性类型
属性值
可用性
system/management/rad
接口稳定性
Private(专用)

另请参见

usermgr-1(3rad), radadrgen(1), pipe(2), getpeerucred(3C), pam(3PAM), scf_handle_create(3SCF), attributes(7), smf(7), smf_method(7), svc.startd(8)

Managing User Accounts and User Environments in Oracle Solaris 11.4

附注

rad 的两个实例由系统提供,并且在缺省情况下处于启用状态。

svc:/system/rad:local 会侦听以下路径的 AF_UNIX 连接:

  • /system/volatile/rad/rad socket

  • /system/volatile/rad/radsocket-unauth

  • /system/volatile/rad/radsocket-http

  • /system/volatile/rad/radsocket-unauth-http

第一个和第三个 AF_UNIX 套接字将使用 getpeerucred(3C) 自动验证连接进程,而另外两个套接字要求连接进程进行显式验证。

svc:/system/rad:remote 在端口 12302 (RAD RPC) 和 6788 (HTTP/JSON) 上侦听 TLS 连接,在端口 6789 上侦听 GSS-API(RAD RPC 协议)连接。缺省情况下,此服务处于禁用状态。

这些端口要求所有客户端进行显式验证。

其他系统组件(包括一些桌面管理用户界面)依赖于 rad 的本地实例 (svc:/system/rad:local)。