My Cyberpatriot scripts
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
408 B

#!/bin/bash
function getextras {
diff - "$1" |
grep '>' - |
cut -b 3-
}
sort users.txt > usrtmp
mv usrtmp users.txt
ls /home |
sort |
getextras users.txt |
while read name; do
echo deluser $name
done
sort admins.txt > admtmp
mv admtmp admins.txt
grep 'adm' /etc/group |
cut -f 4 -d ':' |
tr ',' '\n' |
sort |
getextras admins.txt
echo sudo ufw enable