/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 命令,允许您通过脚本和调度器在设备上远程执行命令。

参数类型描述
addressalt { ip: ipAddr , ipv6-address: composite { ip6: ip6Addr , interface: [ iface_enum] } }远程主机的 IPv4 或 IPv6 地址。
commandstring要执行的远程命令。
userstring远程主机的用户名。
passwordstring远程主机的密码。您应使用 SSH PKI 认证,而不要使用明文密码。
portnumSSH 服务器监听的 TCP 端口。默认值:22。
known-hosts-ignorebool跳过主机密钥验证
src-addressalt { ip: ipAddr , ip6: ip6Addr }连接时使用的源地址。支持 IPv4 和 IPv6。
vrfenum运行命令所使用的 VRF;连接在该路由表内建立。
output-to-filestring将输出写入文件,而不是写入 'output' 变量。
只读参数类型描述
exit-codenum远程命令 shell 报告的退出代码;命令运行时为 0。连接或认证失败会中止 ssh-exec 本身,而不会返回。
outputstring返回远程执行命令的输出。