Skip to content

Commit

Permalink
change all users passwords, and parse ls like a boss
Browse files Browse the repository at this point in the history
  • Loading branch information
Seth-Johnson committed Nov 13, 2015
1 parent 5085f02 commit 968c9e7
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion Ubuntu_Hardening/harden_ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,22 @@ check_no_pass() {

list_sensitive_groups() {
echo "Members of group 'adm':"
grep adm /etc/group | cut -d ':' -f 4
grep adm /etc/group | cut -d ':' -f 4
echo "Members of group 'root':"
grep root /etc/group | cut -d ':' -f 4
echo "Members of group 'sudo':"
grep sudo /etc/group | cut -d ':' -f 4
}

change_user_passwords() {
pass='CyberPatriot!'
echo "Changing all user passwords to 'CyberPatriot!''"
echo 'NEVER RUN THIS IN PROD!'
for i in $(ls /home); do # ls like a boss
chpasswd <<< "$i:$pass"
done
}

echo "##### Setting apt update settings #####"
set_update_settings

Expand All @@ -118,6 +127,11 @@ check_no_pass
echo "##### Searching for any media files in /home #####"
find_media_files_in_dir

read -p "Would you like to change all user passwords?" answer
if [[ $answer == [yY] ]]; then
change_user_passwords
fi

echo "##### Listing users in sensitive groups #####"
list_sensitive_groups

Expand Down

0 comments on commit 968c9e7

Please sign in to comment.