Solved

Messed up my systems default "root" user

Posted on 2003-12-03
6
488 Views
Last Modified: 2013-12-15
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
Comment
Question by:nexisvi
6 Comments
 
LVL 18

Accepted Solution

by:
liddler earned 50 total points
ID: 9868868
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
 
LVL 24

Expert Comment

by:shivsa
ID: 9868873
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
 
LVL 18

Expert Comment

by:liddler
ID: 9868930
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
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
LVL 24

Expert Comment

by:shivsa
ID: 9868961
but group must have got changed, so anyway he has to run to make sure he has root group also.
0
 
LVL 7

Expert Comment

by:glassd
ID: 9869927
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
 

Author Comment

by:nexisvi
ID: 9870253
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Currently, there is not an RPM package available under the RHEL/Fedora/CentOS distributions that gives you a quick and easy way to allow PHP to interface with Oracle. As a result, I have included a set of instructions on how to do this with minimal …
Daily system administration tasks often require administrators to connect remote systems. But allowing these remote systems to accept passwords makes these systems vulnerable to the risk of brute-force password guessing attacks. Furthermore there ar…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now