Following are steps for creating new sudo user and give sudo root access to newly created user.
1. If you want to add new sudo root user and group with same name for e.g. ss1 user and ss1 group, run below command.
2. Change password of newly created sudo root user as follows. In this example the user is ss1.
(a) visudo
(b) Search for below line
username ALL=(ALL) NOPASSWD: ALL
Just below above line add below line. Replace ss1 username as needed. With this we are giving sudo root access to ss1 user (without being prompted for password when running sudo command)
ss1 ALL=(ALL) NOPASSWD: ALL
4. Now login to Linux node using newly created sudo user, in this example ss1.
5. sudo to root as follows
Products to which Article Applies
Oracle Linux. Steps in this Article also works on other flavors of Linux other.
1. If you want to add new sudo root user and group with same name for e.g. ss1 user and ss1 group, run below command.
useradd -d /home/ss1 -s /bin/bash -m ss1
In case you want to use different group for newly added user (with group name different than user name), Run groupadd command to create new group followed by useradd command to add new user to the newly created group.2. Change password of newly created sudo root user as follows. In this example the user is ss1.
passwd ss1
3. Add newly created user to /etc/sudoers files. For this make below changes to /etc/sudoers file and save it.(a) visudo
(b) Search for below line
username ALL=(ALL) NOPASSWD: ALL
Just below above line add below line. Replace ss1 username as needed. With this we are giving sudo root access to ss1 user (without being prompted for password when running sudo command)
ss1 ALL=(ALL) NOPASSWD: ALL
4. Now login to Linux node using newly created sudo user, in this example ss1.
5. sudo to root as follows
sudo su -
You should be logged into root user without being prompted for password.Products to which Article Applies
Oracle Linux. Steps in this Article also works on other flavors of Linux other.
Article Author: Tarun Boyella
No comments:
Post a Comment