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

Version Path
rudy-0.9.8.010 support/randomize-root-password
rudy-0.9.8.009 support/randomize-root-password
rudy-0.9.8.008 support/randomize-root-password
rudy-0.9.8.007 support/randomize-root-password
rudy-0.9.8.006 support/randomize-root-password
rudy-0.9.8.005 support/randomize-root-password
rudy-0.9.8.004 support/randomize-root-password
rudy-0.9.8.003 support/randomize-root-password
rudy-0.9.8.002 support/randomize-root-password
rudy-0.9.8.001 support/randomize-root-password
rudy-0.9.7.001 support/randomize-root-password
rudy-0.9.6.001 support/randomize-root-password
rudy-0.9.5.004 support/randomize-root-password
rudy-0.9.5.003 support/randomize-root-password
rudy-0.9.5.002 support/randomize-root-password
rudy-0.9.5 support/randomize-root-password
rudy-0.9.4 support/randomize-root-password
rudy-0.9.3 support/randomize-root-password
rudy-0.9.2 support/randomize-root-password
rudy-0.9.0 support/randomize-root-password