$ sudo passwd john Grant Root Privileges To Existent UserĬool Tip: Dot the i’s and cross the t’s on file and folder permissions in Linux! Make it more clear! Read more → Use the following commands to create a user john, grand him the same privileges as root and set him a password: $ sudo useradd -ou 0 -g 0 john To create a user with exactly the same privileges as root user, we have to assign him the same user ID as the root user has ( UID 0) and the same group ID ( GID 0). Let’s say you need to create a new user and grant him root access to the server. Warning: Before moving forward, read the comments below and DON’T FOLLOW THE STEPS FROM THIS ARTICLE if you don’t understand of what you are doing and what impact this may have! Grant Root Privileges To New User ![]() Warning: Giving a non-root user all the permissions of root is very dangerous, because the non-root user will be able to do literally anything that could cause a big trouble if account is hijacked.Ĭheck SSH Server Settings: If you have disabled root access in SSH server settings, by setting PermitRootLogin no in /etc/ssh/sshd_config – you won’t be able to login if your user has UID 0. This can be easily done by changing UID (user id) and GID (group id) in /etc/passwd file.Īlso you will learn how to just add user to root group and i will explain how to delete user with root privileges.Īctually it is not a good idea to give all the privileges of root to a non-root user and outside the test environment i would not recommend to have multiply superusers. From this article you’ll learn how to create a user in Linux and grant root access to him or how to grant root privileges to already existent user.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
February 2023
Categories |