how to login to another user with its enviroment on ubuntu how to login to another user with its enviroment on ubuntu jenkins jenkins

how to login to another user with its enviroment on ubuntu


su is short for switch user.

With su jenkins you become user jenkins, but don't execute his profile scripts.
Calling su - jenkins or su -l jenkins does the same, but also executes his profile scripts.

See also the su manpage.

In case you don't have the password for user jenkins (or don't want to login with password), but are allowed to call "sudo" you can also add "sudo" in front of the su (i.e. sudo su - jenkins )


Use sudo su -l jenkins

You'll have the env as you logged in directly to Jenkins.