I used to be able to change to jenkins user from root by doing
su jenkins
but with my new jenkins installation, I have to do sudo su -s /bin/bash jenkins
does anyone know how I can just do su - jenkins again?
Look at the shell specified in /etc/passwd for the jenkins user. You can do so by running something like:
grep jenkins /etc/passwd
The output will look similar to this:
jenking:1001:1001::/usr/local/jenkins:/bin/false
The last field is the login shell of the user. Here you can see it is set to /bin/false which will immediately exit.
The solution is to specify which shell to use as you described:
su -s /bin/bash jenkins
Or modify the login shell of the jenkins user with "usermod(8)" (executed as a root user) :
usermod -s /bin/bash jenkins
Then grep jenkins /etc/passwd
should now output something like:
jenkins:1001:1001::/usr/local/jenkins:/bin/bash
After which. su - jenkins
will work as you expect.