- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: script to check for null passwords
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2005 03:50 AM
07-06-2005 03:50 AM
script to check for null passwords
And also check for any user that has a GID of 0 except for root.
Thanks for the time and points will be assigned.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2005 04:31 AM
07-06-2005 04:31 AM
Re: script to check for null passwords
grep -v root /etc/passwd | awk -F ":" '$3 == 0 { print $1 }'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2005 04:36 AM
07-06-2005 04:36 AM
Re: script to check for null passwords
cat /etc/shadow | awk -F ":" '$2 == "" { print $1 }'
This could tell y you the username with null password.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2005 04:37 AM
07-06-2005 04:37 AM
Re: script to check for null passwords
If you use the /etc/shadow file
cat /etc/shadow | awk -F: '{print $1, $2}'
This will list the 1st field and the 2nd field of the shadow file. If the 2nd field of the LOGNAME is blank, no passwd.
Other option is to use the passwd -S 'LOGNAME' command. This will give a verbose output of the passwd status for the account.
Example;
cat /etc/passwd | awk -F: '{print $1}' | while read line
do
passwd -S $line
done
For GID=0
cat /etc/group | awk -F: '{print $1, $3}'
This will list the LOGNAME and the GID value.
There are the GUI tools available as well that will allow you to look at the settings. No scripts required.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2005 04:48 AM
07-06-2005 04:48 AM
Re: script to check for null passwords
Those accounts with the !! characters, the account is locked. Cannot use this account to login. These accounts may be required for applications you may have and it is OK to have these accounts locked.
Personally, I like the passwd -S $LOGNAME
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2005 05:19 AM
07-06-2005 05:19 AM