Re: List of accounts
Re: List of accounts
- Subject: Re: List of accounts
- From: Geoff Lee <email@hidden>
- Date: Tue, 11 Aug 2009 12:28:40 +0100
On Aug 10, 2009, at 1:46 PM, Tim Murison wrote:
Hi,
I'm trying to determine how to get a list of BSD user ids that can
login to
the machine, either with a GUI or via ssh.
My current approach is to build something like the 'dscacheutil -q
user'
command filtering on users who have a valid shell. I'm thinking
that a valid
shell would be determined by looking in the /etc/shells file.
Is there a better way of doing this?
This will work to an extent, but it's worth bearing in mind that if
you're connected to a directory service like Active Directory, you'll
only get the first 1000 users back (for some definition of 'first')
out of potentially a lot more.
You possibly also want to take into account (doubtless among other
things) the contents of the com.apple.access_ssh and
com.apple.acess_loginwindow groups, the contents of /etc/sshd_config
and the status of the user's password (with regard to policy), all of
which can affect whether a user can log in.
If you want to be accurate, it's a tricky one!
-geoff
______________________________________
Geoff Lee <email@hidden>
Computing Support
School of Arts, Culture and Environment
University of Edinburgh
20 Chambers St,
Edinburgh, Scotland,
EH1 1JZ
Tel: +44 (0)131 650 2341
______________________________________
--
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden