Can't su to user jenkins after installing Jenkins
jenkins is a service account, it doesn't have a shell by design. It is generally accepted that service accounts shouldn't be able to log in interactively.
I didn't answer this one initially as it's a duplicate of a question that has been moved to server fault. I should have answered rather than linked to the answer in a comment.
if for some reason you want to login as jenkins, you can do so with:sudo su -s /bin/bash jenkins
How to become a Jenkins user?
Basically for this Jenkins user jenkins
bash was not configured.
jenkins:x:496:492:Jenkins Continuous Build server:/var/lib/jenkins:/bin/false
So we need to set the bash for this user and that resolved the issue. I used the following command:
sudo usermod -s /bin/bash jenkins
See below:
jenkins:x:496:492:Jenkins Continuous Build server:/var/lib/jenkins:/bin/bash
And now I can perform su and can use bash.
Jenkins User Login - Ubuntu
Aah Found the solution
running
sudo usermod -s /bin/bash jenkins
did the job.
similar question posted here too
How to access Jenkins after enabling require login?
To fix this follow the instructions
Stop Jenkins (the easiest way to do this is to kill the servlet
container.)Go to $JENKINS_HOME in the file system and find config.xml file.
Open this file in the editor.
Look for the <useSecurity>true</useSecurity> element in this file.
Replace true with false
Remove the elements authorizationStrategy and securityRealm
Start Jenkins
Related Topics
@Reboot Is Not Working in Cron
Awk One Liner Select Only Rows Based on Value of a Column
Should Linux Cron Jobs Be Specified with an "&" to Indicate to Run in Background
Doesn't Sh Support Process Substitution <(...)
How to List (Ls) the 5 Last Modified Files in a Directory
Control Mouse by Writing to /Dev/Input/Mice
How to Check the Version of Openmp on Linux
Register Variables in Loop in an Ansible Playbook
Bash Alias with Argument and Autocompletion
Run Bash Script from Another Script Without Waiting for Script to Finish Executing
How to Sort Files Numerically from Linux Command Line
What Does Double Slash // in 'Cd //' Mean in Linux
Linux Kernel System Call Returns -1 Instead of {-1, -256}
How to Mount a Remote Linux Folder in Windows Through Ssh