我有批处理脚本,其中包含 plink 以加载现有的putty会话并在 unix 服务器上运行少量命令。从 windows 命令行可以正常运行相同的批处理脚本,但是当我从Jenkins运行它时,它无法运行并提供以下输出。
PuTTY Link: command-line connection utility
Release 0.70
Usage: plink [options] [user@]host [command] ("host" can also be a
PuTTY saved session name)
Options:
-v show verbose messages
-load sessname Load settings from saved session
-ssh -telnet -rlogin -raw force use of a particular protocol (default
SSH)
-P port connect to specified port
-l user connect with specified username
-m file read remote command(s) from file
-batch disable all interactive prompts
The following options only apply to SSH connections:
-pw passw login with specified password
-L listen-port:host:port Forward local port to remote address
-R listen-port:host:port Forward remote port to local address
-X -x enable / disable X11 forwarding
-A -a enable / disable agent forwarding
-t -T enable / disable pty allocation
-1 -2 force use of particular protocol version
-C enable compression
-i key private key file for authentication
答案 0 :(得分:0)
我有同样的问题。我通过运行会话中存储的命令来解决它。例如,不要运行:
plink -load my-session
我改用
plink -serial \\.\COM9 -sercfg 115200,8,1,N,N
由于每个用户都将会话保存在Windows注册表中,因此我认为Jenkins无法访问它们。