Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 506
  • Last Modified:

Messed up my systems default "root" user

Ok, I added a new user with a UID of 0, meaning this user has superuser privileges.  Everything seemed to be working fine, until I noticed that now all the files that normally belong to the user "root" (the default root user) now belong to this new user.  Also, the command "su" now logs onto this new users account, instead of the default "root" account.  How do I fix my system so the files once again belong to "root" instead of this new user, and so that "su" defaults to the root account (of course you still need a password, etc)

Thanks
0
nexisvi
Asked:
nexisvi
1 Solution
 
liddlerCommented:
remove the other user, the files are awned by UID 0 and su makes you the user with UID 0. Best not to have another user UID 0 , use sudo to give another user root privs
0
 
shivsaCommented:
uid 0 belongs to root and u should have given it to any other users.
if u want user to give root access, give him su access. and him to root group.

u can possible delete the user entry from password file. keep all his directory and all.

then login as a root and
chown(chage owner) back to root to the files which used to belong root.
0
 
liddlerCommented:
shivsa,
"shouldn't" have to chown as the files will be owned by UID 0, so it's just the OS parsing the passwd file and getting the wrong username for UID 0, if there is only root having UID 0, it will report root as the owner of the files again
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
shivsaCommented:
but group must have got changed, so anyway he has to run to make sure he has root group also.
0
 
glassdCommented:
On some OS's it is possible to add a second user with ID 0, but the true root account should be first in the password file. I've used the method to give a user temporary root access with their own password while ensuring that the real root password is available for the admins.
0
 
nexisviAuthor Commented:
I had to completely remove the user from the system.  The order in the passwd file didn't matter, no matter where I put the user and the "root" user, it would still see this new user as the main "root" user.  Once I erased the user, it was back to normal.

thanks for all the suggestions
0

Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now