alone will print a line from /etc/passwd that matches ^$user. What does that line have to do with logical if test?
You are missing backticks and operator there.
Helo,
I have created one group called RBAC.(roll back access control)
Now when I created user of RBAC its entry in /etc/passwd file is given below:
roleadm:x:120:109:RBAC User:/home/pds_RBAC:/bin/false
I have keep at the end /bin/false because I dont want to give direct login to the user... (2 Replies)
Hello, I am running a Solaris 8 system.
I Have encountered that each time I ask the system to report to me the users who have or are about to exceed their quota limit for disk usage, a strange number appears in a user name, it does not appear in my /etc/group or in my /etc/passwd files
The user... (13 Replies)
Hello
I have a new job and I need change the last user administrator, I dont know if is easier change some things about this user or add my user in the group with every permission, how can I do it. I dont know which is the group. I think is no only useradd en after modify /etc/passwd.
Tank... (14 Replies)
Good morning everybody,
I'm using Minix and I want to find the user with less number of files in the system
I have tried this solution:
#! /bin/sh
indice=0
listaCut=$(cut -f 3 -d : /etc/passwd)
for USER in $listaCut; do
cont=0
listaFind=$(find / -user "${USER}" -type -f)
... (4 Replies)
Hello!
I am new to the forum and I need help on restoring root user's password or access the form of single user mode under operating system very long-standing family bsd - Unix system V I think it's also called srv4. I managed to enter the owner of IPL, and a moment after the rise of system... (2 Replies)
Hi ,
I am trying to :wall: my head while scripting ..I am really new to this stuff , never did it before :( .
how to find cpu's system high time and user time high in a script??
thanks , help would be appreciated !
:) (9 Replies)
Hello,
In our environment some users mess up with the system ( install / uninstall ) software..
unfortunately the root is open to several users (several of them have sudo access)
How to track which user is trying to do this ( I'd like to know which user and what ipaddress. )
Experts please... (2 Replies)
What I'm trying to do is write a script in Perl to find a user and if that user exist it would print "User Exist, Pls Try Again". If The user doesn't exist I'm able to create a user with a password.
Any suggestions? (3 Replies)
Discussion started by: GoBoyGo
3 Replies
LEARN ABOUT REDHAT
getpw
GETPW(3) Linux Programmer's Manual GETPW(3)NAME
getpw - Re-construct password line entry
SYNOPSIS
#include <pwd.h>
#include <sys/types.h>
int getpw(uid_t uid, char *buf);
DESCRIPTION
The getpw() function re-constructs the password line entry for the given user uid uid in the buffer buf. The returned buffer contains a
line of format
name:passwd:uid:gid:gecos:dir:shell
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 getpw() function returns 0 on success, or -1 if an error occurs.
ERRORS
ENOMEM Insufficient memory to allocate passwd structure.
FILES
/etc/passwd
password database file
CONFORMING TO
SYSVr2.
BUGS
The getpw() function is dangerous as it may overflow the provided buffer buf. It is obsoleted by getpwuid().
SEE ALSO fgetpwent(3), getpwent(3), setpwent(3), endpwent(3), getpwnam(3), getpwuid(3), putpwent(3), passwd(5)GNU 1996-05-27 GETPW(3)