how can distingiush user account


 
Thread Tools Search this Thread
Operating Systems HP-UX how can distingiush user account
# 1  
Old 02-05-2009
how can distingiush user account

example

root::0:3::/:/sbin/sh
daemon:*:1:5::/:/sbin/sh
bin:*:2:2::/usr/bin:/sbin/sh
sys:*:3:3::/:
adm:*:4:4::/var/adm:/sbin/sh
uucp:*:5:3::/var/spool/uucppublic:/usr/lbin/uucp/uucico
lp:*:9:7::/var/spool/lp:/sbin/sh
nuucp:*:11:11::/var/spool/uucppublic:/usr/lbin/uucp/uucico
hpdb:*:27:1:ALLBASE:/:/sbin/sh
puppy::19:3::/:/sbin/sh

how can i distingush usr account and non user account
when i read /etc/passwd file

I only grep user account like example ,root ,puppy

which condition can that i determine these

thanks
# 2  
Old 02-06-2009
Real users usually have home directories in /home and have a real shell. The first test is usually sufficient, although in some systems, FTP and WWW have "home" directories.

This should do the trick:
Code:
awk -F: '$6 ~ /home/ && $7 ~ /sh$/' /etc/passwd

Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. HP-UX

User account

I need to check actual date a user was disabled on my HP-UX server. Audit is claiming the user account was active during the last audit exercise. (7 Replies)
Discussion started by: cyriac_N
7 Replies

2. UNIX for Dummies Questions & Answers

User account logging

Hi - I want to log commands typed by oraapps user with time into some log file on runtime. HISTTIMEFORMAT="%d/%m/%y %T " works but any one with oraapps user can delete the history. OS : RHEl 5.6 Any help is appreciated. (5 Replies)
Discussion started by: oraclermanpt
5 Replies

3. AIX

user account priviledges

Hi Admins, As per my knowledge there are two types of user accounts in unix. root and normal users. If there are any user types for which we can give some priviledges..? Actually i want to restrict root access and create new accounts for admins with some of the priviledges. Please let me... (6 Replies)
Discussion started by: newsol
6 Replies

4. Solaris

Help me create new user account

I want create user. That user should be login to any server without asking password. How? tell me in detail. :wall: (3 Replies)
Discussion started by: Navkreddy
3 Replies

5. Shell Programming and Scripting

How to suspend a user account?

Hi, guys. I have two questions: I need to write a script, which can show all the non-suspended users on system, and suspend the selected user account. There are two things I am not sure: 1. How can I suspend user's account? What I think is: add a string to the encrypted password in shadow... (2 Replies)
Discussion started by: daikeyang
2 Replies

6. UNIX for Dummies Questions & Answers

Difference between : Locked User Account & Disabled User Accounts in Linux ?

Thanks AVKlinux (3 Replies)
Discussion started by: avklinux
3 Replies

7. Post Here to Contact Site Administrators and Moderators

user account

hi how to disable the useraccount in aix (should not remove). (1 Reply)
Discussion started by: chomca
1 Replies

8. UNIX for Dummies Questions & Answers

show all user account

I have a question about show all create user account. What commend do that thank`s for your help :) (6 Replies)
Discussion started by: Deux
6 Replies

9. UNIX for Dummies Questions & Answers

creatin user account

hi all, i m tryin to create a new account on the unix work station. do i use 'useradd' command? can u guyz advice on the usage of 'useradd' command as it can comes with 'useradd -D' or 'useradd -e' thanks :confused: (1 Reply)
Discussion started by: damian
1 Replies
Login or Register to Ask a Question