-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocker-entrypoint.sh
35 lines (35 loc) · 996 Bytes
/
docker-entrypoint.sh
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
33
34
35
#!/bin/bash
echo ">>>>>>>>>>>>>> running cruser tool"
cruser
sleep 1
echo ""
echo ">>>>>>>>>>>>>> checking content of '/etc/passwd'"
cat /etc/passwd
sleep 1
echo ""
echo ">>>>>>>>>>>>>> checking if user's homedirectories exists'"
ls -al /home/
sleep 1
echo ""
echo ">>>>>>>>>>>>>> checking content of authorized_keys files"
for f in /home/*/.ssh/authorized_keys; do echo "Filename: $f"; cat "$f" && echo ""; done
sleep 1
echo ""
echo ">>>>>>>>>>>>>> checking permissions of '.ssh' directories and 'authorized_keys' files"
ls -al /home/*/ | grep ssh
sleep 1
ls -al /home/*/.ssh/authorized_keys
sleep 1
echo ""
echo ">>>>>>>>>>>>>> checking content of '/etc/sudoers.d' directory and files permissions"
ls -al /etc/sudoers.d/
sleep 1
echo ""
echo ">>>>>>>>>>>>>> ehcking content of sudoers files "
for f in /etc/sudoers.d/*; do echo "Filename: $f"; cat "$f" && echo ""; done
sleep 1
echo ""
echo ">>>>>>>>>>>>>> trying if sudo not broken"
sudo echo "!!!!!!!!!!!SUDO WORKS!!!!!!!!!!!"
sleep 1
echo ""