I have a simple one-column list of users. It comes from the lastlog command. I need to be able to tell if these accounts are disabled and I do not have root access. I can only view with more and execute the lastlog command. I need to see if users that havent logged in within the last 90 days are still active.
So far I execute
sudo lastlog -b 90
Which gives me the users that logged in..in the last 90 days. Now I just run it through awk printing the first field and that is my simple user list. Now Id like to basically see if in /etc/passwd, their shell is /bin/bash and if in /etc/shadow, there is a !
in their line. How can I do this. I tried for loops and while loops and cant seem to get it right? Any help would be appreciated.
grep -f users bash_users
. Does that sound right?