How to Give all the powers Of Root account to another user account? With full command and detail.
It's best to first look in /etc/sudoers for lines that look like:
## Allows people in group wheel to run all commands %wheel ALL=(ALL) ALL ## Same thing without a password # %wheel ALL=(ALL) NOPASSWD: ALL
It's the "wheel" group on CentOS and "admin" on Ubuntu. If you are OK with giving this user all root powers, just make them a member of the group:
usermod -a -G wheel username
Or if you want to be more restrictive, add a line to give them more specific permissions:
username ALL = (named) /usr/sbin/named
This lets username run /usr/sbin/named, but only as user named. In some distros, you can add this line to a new file /etc/sudoers.d/username so that your distro can upgrade the delivered base file without stomping on your edits.
Then, your user can run
sudo -u named /usr/sbin/named
in the more restrictive case, or in the former example
sudo make me-a-sandwich
to run a command as root. If you just want a shell as root,
Putting it together you will want to add any user you want to have root privileges to the wheel group. They will then preface any command with
sudo to run a command (and only that command) as root. At the end of the command they will be back to a regular user.
sudo ls /root