/system/ssh-exec
ssh-exec
The ssh-exec command is a non-interactive SSH command, allowing you to execute commands remotely on a device through scripts and scheduler.
system/ssh-exec
Type: Command
ssh-exec 命令是一个非交互式 SSH 命令,允许您通过脚本和调度器在设备上远程执行命令。
| 参数 | 类型 | 描述 |
|---|---|---|
address | alt { ip: ipAddr , ipv6-address: composite { ip6: ip6Addr , interface: [ iface_enum] } } | 远程主机的 IPv4 或 IPv6 地址。 |
command | string | 要执行的远程命令。 |
user | string | 远程主机的用户名。 |
password | string | 远程主机的密码。您应使用 SSH PKI 认证,而不要使用明文密码。 |
port | num | SSH 服务器监听的 TCP 端口。默认值:22。 |
known-hosts-ignore | bool | 跳过主机密钥验证 |
src-address | alt { ip: ipAddr , ip6: ip6Addr } | 连接时使用的源地址。支持 IPv4 和 IPv6。 |
vrf | enum | 运行命令所使用的 VRF;连接在该路由表内建立。 |
output-to-file | string | 将输出写入文件,而不是写入 'output' 变量。 |
| 只读参数 | 类型 | 描述 |
|---|---|---|
exit-code | num | 远程命令 shell 报告的退出代码;命令运行时为 0。连接或认证失败会中止 ssh-exec 本身,而不会返回。 |
output | string | 返回远程执行命令的输出。 |