Just out of curiosity, do you know if ohai actually scans the file, or uses the getpwent utility or API to do it?
The difference is that getpwent would also pick up users coming from Active Directory, LDAP etc., depending on you nssswitch.conf configuration.
Kevin Keane
The NetTech
http://www.4nettech.com
Our values: Privacy, Liberty, Justice
See https://www.4nettech.com/corp/the-nettech-values.html
-----Original message-----
From: Daniel DeLeo < >
Sent: Wednesday 25th March 2015 10:22
To:
Subject: [chef] Re: Re: User Management
On Wednesday, March 25, 2015 at 8:02 AM, ANGELA EBIRIM wrote:
> Hi,
>
> Does anyone know how to extract the list of current users on a node?
>
> I've been interrogating the OHAI attributes of a node (I'm sure it would be a node attribute) but can't find it.
>
> Many thanks
Ohai fetches the data as etc/passwd, i.e., it should be under node[“etc”][“passwd”].
BTW, you can just run `ohai` on the command line to see all the data it produces. It’s quite a lot but you can scan it to find the data you’re looking for. You can also filter the command line output by passing the path to the attributes you want if you know them, e.g., `ohai etc/passwd` prints just the passwd data.
HTH,
--
Daniel DeLeo
Archive powered by MHonArc 2.6.16.