Hello ppl,
A small mistake of mine has led the /etc/passwd file deleted. So i went to rescue mode and used the following command echo "root::0:0:Superuser:/:/bin/bash" > passwd
but that did not get effect in anyway way. when I switch back to normal mode the root is still asking for a passwd.... (3 Replies)
I have left unix for a long time.Almost forget everthing.:(
Anybody can tell me what is the meaning?
wc /etc/passwd
9 16 1155 /etc/passwd
and
$ wc -l /etc/passwd
wc -l /etc/passwd
9 /etc/passwd (1 Reply)
Is there any way to allow users to access the etc/passwd file for commands like whoami but not be able to read the file? If I don't put a user in the security group and change the permissions on the etc/passwd file to 640 (rw-r-----) the users can login but the whoami command doesn't work for... (5 Replies)
Hi Folks,
I have Solaris 10, latest release.
We have passwd aging set in /etc/defalut/passwd.
I have an account that passwd should never expire. Acheived by emptying associated users shadow file entries for passwd aging.
When I reset the users passwd using passwd command, it re enables... (3 Replies)
Hello ,
how to open utemp,getpwuid files.I know what info these files will carry but i dont know ow to open see the info present in it.
Thanks to help. (4 Replies)
Hi!
i've been searching a way to display the users who are in the /etc/passwd directory...using ls or grep or cat command should do it?i can't find a way to get this right..i mean none of the preview commands function sounded good to me to use... (9 Replies)
Hi,
I've a problem regarding understanding of result of passwd -s command.
> passwd -s
abc PS 05/24/12 0 441
I'm not a super user. But i need to write a simple code for checking password expiry and send an email to the team id. Is there any other command or way to achieve this?... (6 Replies)
Discussion started by: sam_bd
6 Replies
LEARN ABOUT REDHAT
endpwent
GETPWENT(3) Linux Programmer's Manual GETPWENT(3)NAME
getpwent, setpwent, endpwent - get password file entry
SYNOPSIS
#include <pwd.h>
#include <sys/types.h>
struct passwd *getpwent(void);
void setpwent(void);
void endpwent(void);
DESCRIPTION
The getpwent() function returns a pointer to a structure containing the broken out fields of a line from /etc/passwd. The first time it is
called it returns the first entry; thereafter, it returns successive entries.
The setpwent() function rewinds the file pointer to the beginning of the /etc/passwd file.
The endpwent() function closes the /etc/passwd file.
The passwd structure is defined in <pwd.h> as follows:
struct passwd {
char *pw_name; /* user name */
char *pw_passwd; /* user password */
uid_t pw_uid; /* user id */
gid_t pw_gid; /* group id */
char *pw_gecos; /* real name */
char *pw_dir; /* home directory */
char *pw_shell; /* shell program */
};
RETURN VALUE
The getpwent() function returns the passwd structure, or NULL if there are no more entries or an error occurs.
ERRORS
ENOMEM Insufficient memory to allocate passwd structure.
FILES
/etc/passwd
password database file
CONFORMING TO
SVID 3, BSD 4.3
SEE ALSO fgetpwent(3), getpwnam(3), getpwuid(3), getpw(3), putpwent(3), passwd(5)GNU 1996-05-27 GETPWENT(3)