ssh as Jenkins

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



This entry was posted in linux, testing. Bookmark the permalink.

5 Responses to ssh as Jenkins

  1. mebubo says:

    ssh sudo -u jenkins ?

    • mebubo says:

      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”.

  2. mebubo says:

    …and what I really meant is “ssh machine sudo -u jenkins -i” 🙂

  3. esalagea says:

    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.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s