Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Backports:SLE-15:Update
lynis
tests_users_wo_password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File tests_users_wo_password of Package lynis
#!/bin/sh ################################################################################# # # Author: Thomas Biege <thomas@suse.de> # # Lynis comes with ABSOLUTELY NO WARRANTY. This is free software, and you are # welcome to redistribute it under the terms of the GNU General Public License. # See LICENSE file for usage of this software. # ################################################################################# # # Verifies dbus policy. # ################################################################################# # # TODO: # ################################################################################ # InsertSection "Users, Groups and Authentication" report "[Software]" # ################################################################################# # # Test : AUTH-1000 # Description : Verifies dbus policy. Register --test-no AUTH-1000 --weight M --network NO --description "Verifies if users without a password exist." if [ ${SKIPTEST} -eq 0 ]; then Display --indent 2 --text "- Starting password check for users..." logtext "Test: Checking existence of password" TMPDIR=$(mktemp -d /tmp/lynis.XXXXXX) HPMAX=$(wc -l /etc/passwd | cut -d' ' -f1) awk -F: '$2 == "" && $1 != "" {print $1}' /etc/passwd > $TMPDIR/userwopwd awk -F: '$2 == "" && $1 != "" {print $1}' /etc/shadow >> $TMPDIR/userwopwd sort -u $TMPDIR/userwopwd > $TMPDIR/userwopwd2 HPBAD=0 for i in $(cat $TMPDIR/userwopwd2) do HPBAD=$((HPBAD + 1)) Display --indent 4 --text "${i} has no password set" --result WARNING --color RED done HP=$(expr $HPMAX - $HPBAD) # echo "AddHP $HP $HPMAX" AddHP $HP $HPMAX rm -rf $TMPDIR fi # ################################################################################# # wait_for_keypress # #================================================================================
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor