Thursday, July 23, 2020

How to set Jenkins user as root


to set root user for Jenkins to follow below steps for CentOs


1. Open up the script 
vim /etc/sysconfig/jenkins
2. Find this $JENKINS_USER and change to “root”:
$JENKINS_USER="root"
3. Then change the ownership of Jenkins home, webroot and logs:
chown -R root:root /var/lib/jenkins
chown -R root:root /var/cache/jenkins
chown -R root:root /var/log/jenkins
4) Restart Jenkins and check the user has been changed:
service jenkins restart

DevOps Project | terraform Jenkins AWS EC2 | Infrastructure as Code

Saturday, July 11, 2020

Create New User in EC2 Ubuntu |Create Sudo User | How to Become Root Use...

Create a New Sudo User in AWS EC2 (Ubuntu AMI)

Create a New Sudo User in AWS EC2

(Ubuntu AMI)

Log in your Ec2 Instance using “ec2-user”
ssh ec2-user@<ip> -i <ssh key>
 Log in to your server as the root user.
ubuntu@ip-172-31-24-53:~$ sudo -i
root@ip-172-31-24-53:~#
 Use the adduser command to add a new user to your system.
adduser <username>
root@ip-172-31-24-53:~# adduser test


Set and confirm the new user’s password at the prompt. Use 
strong password to secure account
root@ip-172-31-24-53:~# passwd test
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully

Use the usermod command to add the user to the sudo group.
usermod -aG sudo username
root@ip-172-31-24-53:~# usermod -aG sudo test
By default, on Ubuntu, members of the sudo group have sudo privileges.
Test sudo access on new user account
Use the su command to switch to the new user account.
root@ip-172-31-24-53:~# su test
su - username


As the new user, verify that you can use sudo by prepending “sudo” to the command
that you want to run with superuser privileges.
test@ip-172-31-24-53:/root$ sudo ls -la /root

Top ChatGPT Prompts for DevOps Engineers

  As a DevOps engineer, your role involves juggling complex tasks such as automation, infrastructure management, CI/CD pipelines, and troubl...