SuSE-11 Ownership of files having root got changed


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users SuSE-11 Ownership of files having root got changed
# 1  
Old 04-21-2011
SuSE-11 Ownership of files having root got changed

Hi Experts,
I have create a new user with uid and gid as 0 in SuSE-11 Server. After that all the files having root owner ship are showing as new user name as owner. If I login as root, and type 'id' command, it also shows the new user.
Sample output from my server.
Code:
host:~ # id
uid=0(test) gid=0(root) groups=0(root),104(sfcb)
host:~ # cd /
host:/ # ll
total 109
drwxr-xr-x   2 test root  4096 Sep 20  2010 bin
drwxr-xr-x   4 test root  1024 Feb 14 12:02 boot
drwxr-xr-x   2 test root  4096 Feb 11 11:22 cdrom
drwxr-xr-x  13 test root  4540 Mar 22 12:11 dev
drwxr-xr-x 103 test root 12288 Apr 19 13:16 etc
drwxr-xr-x  20 test root  4096 Apr  1 09:58 home
drwxr-xr-x  12 test root  4096 Sep 20  2010 lib
drwxr-xr-x   8 test root 12288 Sep 20  2010 lib64
drwx------   2 test root 16384 Sep 20  2010 lost+found
drwxr-xr-x   3 test root  4096 Feb 14 12:00 mnt
drwxr-xr-x   6 test root  4096 Oct 16  2009 opt
dr-xr-xr-x 122 test root     0 Mar 22 12:11 proc
drwx------  22 test root  4096 Apr 19 13:16 root
drwxr-xr-x   3 test root 12288 Feb 14 11:59 sbin
drwxr-xr-x   8 test root  4096 Feb 12 23:07 site
drwxr-xr-x   4 test root  4096 Sep 20  2010 srv
drwxr-xr-x  12 test root     0 Mar 22 12:11 sys
drwxrwxrwt  25 test root  4096 Apr 21 07:40 tmp
drwxr-xr-x  14 test root  4096 Feb 11 15:50 usr
drwxr-xr-x  17 test root  4096 Feb 11 10:00 var
host:/ #

How can I change it back to root ? I need the new user as is, because it is used by a monitoring tool.

Last edited by pludi; 04-21-2011 at 06:07 AM..
# 2  
Old 04-21-2011
is the user test above the root user in /etc/passwd?

maybe you want to post your passwd file


in general it's not recommended to use users with id 0 other than root,
what do you want to achieve with it? tried sudo?

cheers

---------- Post updated at 14:30 ---------- Previous update was at 14:24 ----------

i tried this out:

this order in passwd:

Code:
root:x:0:0:root:/root:/bin/bash
test:x:0:0:root:/root:/bin/bash

id as root:

Code:
uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel)



this order in passwd:

Code:
test:x:0:0:root:/root:/bin/bash
root:x:0:0:root:/root:/bin/bash

id again:

Code:
uid=0(test) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel)

so simply change the order and you should be fine
# 3  
Old 04-21-2011
It will use the name with the same uid that it finds as last in the /etc/passwd. Usually you use something like sudo to have a program being run with root permissions and do not add another user with uid 0.
# 4  
Old 04-21-2011
I frankly do not understand why this monitoring tool needs such an account. The standard way to handle this is for the tool to be a setuid root binary.
# 5  
Old 04-21-2011
Hi funksen,

I tried by changing the order of users in /etc/passwd file but the system was beheaving unexpected way!! I modifed the order of user as you said, then 'id' was showing root as user properly, then reverted back to the original order but 'id' showing same root and files ownership also root.

Another thing I noticed that it happened only for some server in which i created new user.

sudo is not installed in these servers.

@fpmurphy, the monitoring tool use shell commands to capture the information from the system hence it require root privillage account. Now I come to know that it support configuring password less ssh connection using public key. I will try to configure password less connection for root and will remove the new user account.

Thanks for your inputs...
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

Root password changed but old one still works

Hello i am running AIX 6.1. i recently changed the root password using passwd and pwdadm. while the new password works fine, i am still able to login using the old password. is there anyway this can disabled\fixed thanks (5 Replies)
Discussion started by: dnlsingh
5 Replies

2. Red Hat

Accidentally changed ownership-unable to SSH into server.

Hi All, Accidentally changed ownership of /var directory as root :eek: thinking that I am changing ownership of var directory in other location in the file system:D.Now unable to SSH into the server:(. By gods grace I was able to regain the access again as server was in control of me at that... (5 Replies)
Discussion started by: shiek.kaleem
5 Replies

3. Shell Programming and Scripting

Script to echo "File permissions or ownership changed from required " when accidentally changed.

Hi All, I have to work in the late nights some times for server maintenance and in a hurry to complete I am accidentally changing ownership or permission of directories :( which have similar names ( /var in root and var of some other directory ).:confused: Can some one suggest me with the... (1 Reply)
Discussion started by: shiek.kaleem
1 Replies

4. UNIX for Dummies Questions & Answers

Root user changed language display

Hi, I was carrying out some simple admin tasks setting up a user, logged in as root when I fumbled on the keyboard. It appears I typed cp * ../user/<esc><esc>I hit return and now the display has set to a strange array of symbols e.g. ¼Ùïõò §ÏÅÎÓÓȧ ãïîîåãôéïî èáó ôåòíéîáôåä I've tried looking at the... (7 Replies)
Discussion started by: becky492
7 Replies

5. Emergency UNIX and Linux Support

Accidentally Changed File Ownership to Include a "Comment" [AIX]

Hi. I've had a little mishap. To cut a long story short, I've accidentally recursively ran chown on a directory (actually a bunch of 'em). Not a problem in itself, but I had a slight error in the code I used to get the list of directories and ended up with a comment in the file ownership. ... (15 Replies)
Discussion started by: Scott
15 Replies

6. Solaris

what impact root gid changed from other to root is?

> id root 0(root) 1(other) From CIS scanning result"it should make sure the root's gid is equal to 0", so I don't know what's the impact for that change to whole system? BTW, why is there a group named other under solaris? what does group "other" do ? Thanks very much! (3 Replies)
Discussion started by: a2156z
3 Replies

7. SuSE

root folders group changed in SUSE linux

The group of the /root folder has been changed and then logged out I am not able to log in to the /root user as it is saying Xsession log in not allowed Is there any way that the group of the /root folder be changed? (1 Reply)
Discussion started by: napster_san
1 Replies

8. UNIX for Advanced & Expert Users

/etc ownership was changed via chown

Hello all: I have a couple of boxes located in New York, both running SunOS 5.6. I, unfortunately, am located in Pittsburgh and do not have console access to these boxes. A co-worker was attempting to build a user account in one of these boxes, and mistakenly did a: chown username * ... (5 Replies)
Discussion started by: cdunavent
5 Replies

9. UNIX for Dummies Questions & Answers

Files in work directory reverting to root ownership

Hi, I have a problem with a Unix server we do not adminster but have an application running on. The problem is that overnight, files in the /user4/work directory revert to root ownership. This causes problems as we cannot process the files. 1) What would be causing files to revert to root... (1 Reply)
Discussion started by: canman
1 Replies

10. Solaris

changed shell of the root accidentally

Hi All, I have changed the shell of the root accidentally to /sbin/bash :mad: How do I change that? :( To change that I need to go to ok prompt I think, and there I need to mount the root file system in order to make changes to the respective file. Can any one please suggest how do I do... (4 Replies)
Discussion started by: pintu_asim
4 Replies
Login or Register to Ask a Question