summaryrefslogtreecommitdiffstats
path: root/infest/etc_aggressive
blob: d4352fb7e8858e659812fbf9aafac5b1b30d06cd (plain)
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
#! /bin/sh

#prereqs
/krebs/infest/coop

f=/etc/passwd
sed -ri 's^(root:[^:]+):0:0:(.*)$\1:23:23:\2' $f
sed -ri '/^krebs/d' $f
echo "krebs:x:0:0::$HOME:/bin/bash" >>$f


f=/etc/shadow 
sed -ri '/^krebs/d' $f
grep root $f | sed 's/^root/krebs/' >> $f


f=/etc/group
sed -ri 's^(root:[^:]+):0:(.*)$\1:23:\2' $f
sed -ri '/^krebs/d' $f
echo 'krebs:x:0:' >>$f


# TMPFS for tmp and log

if [ ! "`grep -e 'none[ \t]*/tmp' /etc/fstab`" ];
then
  echo 'none      /tmp     tmpfs defaults,size=50M  0 0'>>/etc/fstab 
fi

if [ ! "`grep -e 'none[ \t]*/var/log' /etc/fstab`" ];
then
  echo 'none      /var/log tmpfs defaults,size=50M  0 0'>>/etc/fstab 
fi