To find the username in /etc/passwd file


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting To find the username in /etc/passwd file
# 8  
Old 12-27-2008
Hi Guys,

Can you please help me on this.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. SuSE

SUSE "passwd username" ask for password 4 times

Below is the error I'm getting. # passwd username Changing password for username. New Password: Reenter New Password: Password changed. New UNIX password: Retype new UNIX password: Password has been already used. Choose another. passwd: Authentication token manipulation error# cat... (0 Replies)
Discussion started by: toor13
0 Replies

2. AIX

When did AIX start using /etc/security/passwd instead of /etc/passwd to store encrypted passwords?

Does anyone know when AIX started using /etc/security/passwd instead of /etc/passwd to store encrypted passwords? (1 Reply)
Discussion started by: Anne Neville
1 Replies

3. Solaris

Forget ILOM Username passwd, how to reterive it from OS with out rebooting

Hi Every One, Is their any command or solution to retrieve ILOM username and password from Solaris OS without rebooting or resetting. Thanks (3 Replies)
Discussion started by: bobby320
3 Replies

4. UNIX and Linux Applications

grep file to find unique instances of username

hello - A SystemOut.log file has recurring entries that follow this format: Principal: auth9.nick.al.gov:389/USERNAME Over the course of a day thousands of lines similar to this are produced, with each username represented hundreds of times. I need to create a new file that shows... (4 Replies)
Discussion started by: 1075FJ40
4 Replies

5. UNIX for Dummies Questions & Answers

Easy Script, just to find the given username if is it online or not

hey guys plz help me..with shell script. i must find the given(the user types a username) username if is it login or not.. i know how to do it logically, but i think that i can't in scripting. Thank you all (5 Replies)
Discussion started by: aintour
5 Replies

6. Shell Programming and Scripting

Find username of user running the script

Hello All, If I have a simple cgi script and want to find the name of the person accessing the page, is it possible? How do I get the name of this user? Please help. I was trying a vague method but it doesn't seem to work with all browsers and versions ... $val=$ENV{'HTTP_COOKIE'}; $name... (1 Reply)
Discussion started by: garric
1 Replies

7. UNIX for Dummies Questions & Answers

Find, make and move file based on username

hi there, i'm new to UNIX( just 3month used), i found my new box contained alot of files and directories in /home/box/ i've tried to search script in tis forum and found many of them but, i don't know how to combine them to make a script, although using pipes. my tasks are: 1) to scan user... (5 Replies)
Discussion started by: Helmi
5 Replies

8. AIX

How do I read username and lastupdate attribute values from /etc/security/passwd

Hi, How do I read username and lastupdate attribute values from /etc/security/passwd file and write the obtained data to another file. The data in the new file should be in this format as shown: avins:12345 root:45234 xyza:23423 Plese let me know this ASAP Thanks, Haroon (3 Replies)
Discussion started by: me_haroon
3 Replies

9. AIX

I want to read username and lastupdate only from /etc/security/passwd and write the s

Hi All, As i asked you in my previous post, I want to read username and lastupdate only from /etc/security/passwd and write the same data to another file: The data in /etc/security/passwd will be in this form for example: smith: password = MGURSj.F056Dj lastupdate = 623078865 flags =... (0 Replies)
Discussion started by: me_haroon
0 Replies

10. UNIX for Dummies Questions & Answers

How to find who fingered my username

Hi Everyone, Whenever someone uses the finger command against my username, he.she gets my info. Is there a way to find who ran the command against my username, somewhat like a log file for the finger command. I would be greatful if someone to clear my query. Regards Anirudh Koul... (3 Replies)
Discussion started by: anirudhkoul
3 Replies
Login or Register to Ask a Question
POSIX_GETPWNAM(3)							 1							 POSIX_GETPWNAM(3)

posix_getpwnam - Return info about a user by username

SYNOPSIS
array posix_getpwnam (string $username) DESCRIPTION
Returns an array of information about the given user. PARAMETERS
o $username - An alphanumeric username. RETURN VALUES
On success an array with the following elements is returned, else FALSE is returned: The user information array +--------+---------------------------------------------------+ |Element | | | | | | | Description | | | | +--------+---------------------------------------------------+ | name | | | | | | | The name element contains the username of the | | | user. This is a short, usually less than 16 char- | | | acter "handle" of the user, not the real, full | | | name. This should be the same as the $username | | | parameter used when calling the function, and | | | hence redundant. | | | | |passwd | | | | | | | The passwd element contains the user's password | | | in an encrypted format. Often, for example on a | | | system employing "shadow" passwords, an asterisk | | | is returned instead. | | | | | uid | | | | | | | User ID of the user in numeric form. | | | | | gid | | | | | | | The group ID of the user. Use the function | | | posix_getgrgid(3) to resolve the group name and a | | | list of its members. | | | | | gecos | | | | | | | GECOS is an obsolete term that refers to the | | | finger information field on a Honeywell batch | | | processing system. The field, however, lives on, | | | and its contents have been formalized by POSIX. | | | The field contains a comma separated list con- | | | taining the user's full name, office phone, | | | office number, and home phone number. On most | | | systems, only the user's full name is available. | | | | | dir | | | | | | | This element contains the absolute path to the | | | home directory of the user. | | | | | shell | | | | | | | The shell element contains the absolute path to | | | the executable of the user's default shell. | | | | +--------+---------------------------------------------------+ EXAMPLES
Example #1 Example use of posix_getpwnam(3) <?php $userinfo = posix_getpwnam("tom"); print_r($userinfo); ?> The above example will output something similar to: Array ( [name] => tom [passwd] => x [uid] => 10000 [gid] => 42 [gecos] => "tom,,," [dir] => "/home/tom" [shell] => "/bin/bash" ) SEE ALSO
posix_getpwuid(3), POSIX man page GETPWNAM(3). PHP Documentation Group POSIX_GETPWNAM(3)