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.
Comments
Post a Comment