It is simple, just ssh the machine where jenkins runs, then do:
sudo su -s /bin/bash jenkins
EDIT: Also works with
sudo -u jenkins -i
ssh sudo -u jenkins ?
I meant “ssh machine sudo -u jenkins”.
ssh and sudo can be done in one step, and you don’t have to use su.
Depending on what you need, you could also configure ssh login as jenkins, and then just “ssh -l jenkins machine”.
…and what I really meant is “ssh machine sudo -u jenkins -i” 🙂
Indeed, it works fine with “sudo -u jenkins -i” after doing ssh on the machine.
Running the full command “ssh machine sudo -u jenkins -i” results in something wired, having a kind of prompt where I can type commands, but cannot use arrow keys (go left to edit text, go up in history), aliases do not exist (like ll), anyway not really usable.
Looks like the login shell of jenkins is /bin/sh, and this is what is run.
Maybe try replacing -i with -s.
Fill in your details below or click an icon to log in:
You are commenting using your WordPress.com account. ( Log Out / Change )
You are commenting using your Twitter account. ( Log Out / Change )
You are commenting using your Facebook account. ( Log Out / Change )
You are commenting using your Google+ account. ( Log Out / Change )
Connecting to %s
Notify me of new comments via email.