We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cd14ee0 commit 308e0dfCopy full SHA for 308e0df
pyinfra/facts/server.py
@@ -478,9 +478,8 @@ class Users(FactBase):
478
479
def command(self):
480
return """
481
-
482
- for i in `cat /etc/passwd | cut -d: -f1`; do
483
- ENTRY=`grep ^$i: /etc/passwd`;
+ for i in `getent passwd | cut -d: -f1`; do
+ ENTRY=`grep ^$i: $(getent passwd)`;
484
LASTLOG_RAW=`(lastlog -u $i 2> /dev/null || lastlogin $i 2> /dev/null)`;
485
LASTLOG=`echo $LASTLOG_RAW | grep ^$i | tr -s ' '`;
486
PASSWORD=`grep ^$i: /etc/shadow | cut -d: -f2`;
0 commit comments