简体   繁体   中英

SSH with login shell - Jenkins slave node

What is the best way to ssh with login shell, ie pass -, -l, --login not just for one off command.

Specifically this is for Jenkins Node, tried to add --login but it's probably something else. Thank you. 在此处输入图像描述

You can see Start Agent used in " How to Connect to Remote SSH Agents? "

Place the following in the Suffix Start Agent Command

-jar-cache <path to jar cache directory>

Make sure there's a leading space so the parameters aren't tacked directly onto the slave.jar itself.

So the prefix/suffix are for Java options, not SSH option.
That is because the SSH Agent plugin is likely using JSch , not system ssh.
So adding the option you want might not be directly possible.
Check though is the .profile / .bashrc are executed on the agent connection (as suggested by this troubleshooting step ): that would be enough for you to set environment variable there.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM