Howto add a user with root permission on CentOS 7

For any reason, you need add a user with root permission on CentOS 7. It’s not security and not recommend in live system. But we may need that for any urgent support, we can create that based on this topic.

Step 1: Create a new user

useradd kevin

Step 2: Reset password for new user

passwd kevin

Step 3: Grant root permission to new user

visudo

Find the line “root ALL=(ALL) ALL”

Add these lines below that line

kevin ALL=(ALL) ALL

Step 4: Save the file and we can start use new user with root permissions.