1752284 Members
5227 Online
108786 Solutions
New Discussion юеВ

Unique User ID

 
SOLVED
Go to solution
Mohammad Sanaullah
Frequent Advisor

Unique User ID

Hi all, Please look into the users ownership, user existed in system with the name of "test" whereas the files belongs to "test" ownership is showing #test
>>>look at this

$pwd
/usr/users/test
-rw-r--r-- 1 #test users 76 Jul 10 2000 .netrc
drwx------ 5 #test users 8192 Dec 23 2007 .netscape
-rwxr-xr-x 1 #test users 2260 Jul 24 2001 .profile
-rw------- 1 #test users 16 Oct 10 2005 .sh_history
drwxr-xr-x 2 #test users 8192 Dec 23 2007 .sysman
-rwxr-xr-x 1 #test users 80 Jun 12 2000 .xsession
drwxr-xr-x 3 #test users 8192 Dec 23 2007 bin
drwxr-xr-x 2 #test users 8192 Dec 23 2007 java
-rw------- 1 #test users 505 Jun 12 2000 mbox

Kindly explain the same, where as doing finger -l test it shows other 3 users login details:
Waiting for the reply full points who will try!!!!
Alive
6 REPLIES 6
Ivan Krastev
Honored Contributor

Re: Unique User ID

Use:
logins -d

to display users with duplicate id's.

regards,
ivan
Suraj K Sankari
Honored Contributor

Re: Unique User ID

Hi,
Please post this output
grep -i test /etc/passwd
and
cat /etc/passwd

I too think some duplicate id will be there

Suraj
Mohammad Sanaullah
Frequent Advisor

Re: Unique User ID

Please find the outputs attached for
grep -i test /etc/passwd
cat /etc/passwd

Alive
Matti_Kurkela
Honored Contributor
Solution

Re: Unique User ID

Instead of actually removing the user "test", someone has attempted to comment out the user by prefixing the line in /etc/passwd with the "#" character.

The comment character "#" is supported in many scripts and configuration files, but NOT in /etc/passwd. The attempt to comment out the user will only cause the username to be changed just as you've seen.

See "grep test /etc/passwd".

File ownership is not determined by human-friendly usernames, but by "machine-friendly" UID numbers. When the "ls" command is used, the command will examine the UID numbers on the disk and find the matching usernames. If more than one username is found for a given UID number, the result depends on the utility doing the lookup... usually the first username with the correct UID is listed.

To fix the problem, you may have to use "vipw". Be very very careful when using it.

MK
MK
SKR_1
Trusted Contributor

Re: Unique User ID

This is not a test user. This user is #test. Somebody has tried to comment out this user, but you can't do it in /etc/passwd file. So its better to uncomment it.

Thanks
SKR
TTr
Honored Contributor

Re: Unique User ID

Just as I suspected. Somebody put the shell script comment character "#" in the password file thinking it would make the OS ignore that account line. The /etc/passwd file does not allow comments in it.

You have two test accounts, the "#test" with uid 243 and the "test" with user id 238.

What do you want to do? I am guessing you want to keep one of the two accounts "test" and find all the files that belong to "#test" and change their ownership to "test".

Or if the new "test" account does not own any files yet, remove it and take the "#" out of the "#test" account.