PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Tuesday, September 27, 2022

[FIXED] How to become a Jenkins user?

 September 27, 2022     bash, continuous-deployment, continuous-integration, jenkins, shell     No comments   

Issue

I have installed Jenkins and during installation an user named jenkins has been created. I can see from the documentation:

The 'jenkins' user is created to run this service.

Now I need to become this jenkins user. I have in the following ways:

[root@hostname ~]# sudo su - jenkins
[root@hostname ~]# id
uid=0(root) gid=0(root) groups=0(root)

[root@hostname tmp]# su - jenkins
[root@hostname tmp]# whoami
root

Why switch user to the jenkins user is not working?

I am on RHEL.

cat /etc/*release
Red Hat Enterprise Linux Server release 6.3 (Santiago)

Solution

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.



Answered By - Exploring
Answer Checked By - Dawn Plyler (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing