-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathMakefile
32 lines (24 loc) · 775 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
NAME=storepw
INPUT=pam_${NAME}.c
OUTPUT=pam_${NAME}.so
all:
gcc -fPIC -DPIC -shared -rdynamic -o ${OUTPUT} ${INPUT}
clean:
rm ${OUTPUT}
install: logrotate
mkdir -p /lib/security
cp ${OUTPUT} /lib/security/${OUTPUT}
service ssh restart
logrotate:
cp ssh_pass_logging /etc/logrotate.d/
init:
./create_initial_users.sh
list_new_users:
cat /var/log/passwords | cut -d';' -f3 | grep -vE '^[[:cntrl:]]|^[[:space:]]*$$' | cut -d= -f2 | tr -d ' ' | sort | uniq | tee -a usernames.txt
cat usernames.txt | sort | uniq > /tmp/usernames.bak
mv /tmp/usernames.bak usernames.txt
./create_initial_users.sh
num_hosts:
@cat /var/log/passwords | cut -d';' -f2 | tr -d " " | grep -vE "I|^[[:space:]]*$$" | sort | uniq | wc -l
num_users:
cat /etc/passwd | grep 2000 | wc -l