Operating System - HP-UX
1833771 Members
1820 Online
110063 Solutions
New Discussion

# An Entry in /etc/passwd

 
SOLVED
Go to solution
Yap Yen Nee
Contributor

# An Entry in /etc/passwd

Hi,

We are running HP-UX 11i here.
Just wondering, if i issue the command vipw and put a '#' in front of any user record, what would happen to the user id? What is the status of the user id now? And what will happen to those files owned by that user?

Thanks.
9 REPLIES 9
Mic V.
Esteemed Contributor
Solution

Re: # An Entry in /etc/passwd

I admit I haven't actually tried it, but I suspect it will be considered the first character of the username.

There are a variety of ways to disable a user's account. One is to change the password field to an asterisk (*) character. Another is to set the shell field to something else (such as /usr/bin/false or /usr/bin/true). The methods mentioned here do not touch any user files, only prevent him from executing a UNIX login.

(SAM is an easy interface to account management if you're interested.)
What kind of a name is 'Wolverine'?
Ranjith_5
Honored Contributor

Re: # An Entry in /etc/passwd

Hi ,

The user wont be able to login. # makes that line as good as not present.

Nothing will happen to the file owned by the used. It wont get deleted.

regards,
Syam

Biswajit Tripathy
Honored Contributor

Re: # An Entry in /etc/passwd

About the files owned by the user, they will
continue to be at the same location as before.
Root will have unlimited access to these files,
ofcourse; and other users will also have access to
these files depending on the file/directory permissions.

- Biswajit
:-)
Ranjith_5
Honored Contributor

Re: # An Entry in /etc/passwd

You cannot use # in your Login ID.Its a special character.

regards,
Syam
Bill Hassell
Honored Contributor

Re: # An Entry in /etc/passwd

The password file has a very restricted format and unlike typical scripting and config files, # is not a comment character. If you do not want to remove a user's passwd file entry, you can disable the account. For untrusted systems, just change the second field to any string less than 13 characters. All attempts to login to this account will fail.

For trusted systems, use modprpw or SAM to lock the account. Always use pwck after *any* manual editing using vi or vipw. And unintended line break or incorrect field count will render the rest of the passwd file unuseable.


Bill Hassell, sysadmin
bhoopathi_1
Frequent Advisor

Re: # An Entry in /etc/passwd

If you add # in front of any user record, the user won't be able to login. It is as good as disabling the user from logging into the machine. All the files owned by the user will have the corresponding userid as the owner.
Ranjith_5
Honored Contributor

Re: # An Entry in /etc/passwd

Hi,

We cannot create a login ID starting with #. As well as if you put a # infront of a login ID that user cannot login further. I re-confirmed it just now in my system

regards,
Syam
Yap Yen Nee
Contributor

Re: # An Entry in /etc/passwd

Thank you all of you for your inputs.
Nguyen Anh Tien
Honored Contributor

Re: # An Entry in /etc/passwd

If you post # and begin of record. that user is invalid on you system. User ID is s not valid now. all file owned by that user is owner by old userid. any new user have same user ID will have sam permission.
(useradd -u option)
tienna
HP is simple