Sha256: afa8b138f26b7c993dd59b982a779fc3fddb8cfb90fba47db40570439cde3220
Contents?: true
Size: 1.05 KB
Versions: 81
Compression:
Stored size: 1.05 KB
Contents
#!/bin/sh # # Randomizes the root password on first boot # # * When the file /root/firstboot is present, this script will # randomize the root password. # # who: delano@solutious.com # when: 2009-03-13 # # NOTE: Works on Gentoo # TODO: Fix for debian if [ -f "/root/firstrun" ] ; then dd if=/dev/urandom count=50|md5sum|passwd --stdin root rm -f /root/firstrun else echo "* Firstrun *" && touch /root/firstrun fi # New Gentoo (to be tested) #if [ -f "/root/firstrun" ] ; then # pword=`dd if=/dev/urandom count=51 | sha1sum` # echo $pword | passwd --stdin root # rm -f /root/firstrun #else # echo "* Firstrun *" && touch /root/firstrun #fi # Fix for debian #if [ -f "/root/firstrun" ] ; then # pword=`dd if=/dev/urandom count=51 | sha1sum` # echo "root:$pword" | chpasswd # rm -f /root/firstrun #else # echo "* Firstrun *" && touch /root/firstrun #fi # Random root password for Gentoo: #dd if=/dev/urandom count=51 | sha1sum | passwd --stdin root # Random root password for Debian/Ubuntu: #echo "root:`dd if=/dev/urandom count=51 | sha1sum`" | chpasswd
Version data entries
81 entries across 81 versions & 3 rubygems