vfclists Asked: 2021-11-05 16:57:02 +0800 CST2021-11-05 16:57:02 +0800 CST 2021-11-05 16:57:02 +0800 CST 当 SSH 授权密钥被限制为命令时,命令如何读取调用中的参数? 772 假设授权密钥仅限于测试参数的命令,例如command="bin/testparameters",ssh 调用是: ssh user@host 'some parameters which may include other commands' 怎么能bin/testparameters读到值'some parameters which may include other commands'。 ssh command 1 个回答 Voted Best Answer Jim L. 2021-11-05T17:23:08+08:002021-11-05T17:23:08+08:00 传递的附加参数ssh出现在环境变量中SSH_ORIGINAL_COMMAND: $ tail -1 .ssh/authorized_keys command="printf '%s\n' \"$SSH_ORIGINAL_COMMAND\"" ssh-rsa AAAA....kz6C5 [email protected] $ ssh [email protected] foo bar farkle foo bar farkle
传递的附加参数
ssh
出现在环境变量中SSH_ORIGINAL_COMMAND
: