#!/bin/sh # http://www.phys.ethz.ch/~franklin/Projects/dphys3/end2stage.simple # - script to be run at end of second install stage for further automation # sets up root uses shell, sime commands and ssh login files # author Neil Franklin, last modification 2005.10.27 # copyright ETH Zuerich Physics Departement, # use under either BSD or GPL license # this script is intended to be run as root at end of install # / is root of the final system, as we are just short before login prompt ### ------ configuration for this script # first CONF_* various site or subnet dependant user config variables # then DEBUG_* various debugging settings # last SYS_* various system internal values # some of these are overridable by hostname input line options # --- CONF_* various site or subnet dependant user config variables # none of these currently # --- DEBUG_*, various debugging settings # these can be set to "yes" by -D option, followed by name without DEBUG_ # set this to sleep after displaying each steps header, number is in seconds #DEBUG_SLEEP=2 # set this to output debug state info after each step #DEBUG_PRINT_STEP=yes # set this to output debug state info and wait after each step #DEBUG_WAIT_STEP=yes # --- SYS_*, various system internal values # none of these currently ### ------ actual implementation from here on # no user settings any more below this point if [ x${DEBUG_SLEEP} != x ] ; then /bin/sleep ${DEBUG_SLEEP} fi # --- get rest of packages I want, even for an install test server #/usr/bin/nice /usr/bin/yes '' | /usr/bin/apt-get install tcsh #/usr/bin/nice /usr/bin/yes '' | /usr/bin/apt-get install less #/usr/bin/nice /usr/bin/yes '' | /usr/bin/apt-get install ssh # --- give user some shell settings /bin/cat << END-CSHRC > /root/.cshrc # .cshrc - set up C shell # author Neil Franklin, last modification 2004.01.04 # reduced version for test hosts 2004.08.05 # turn on filename completion, history set filec set history = 100 # prevent loose files umask 022 if ( \$user == "root") then set path = (/sbin /usr/sbin /usr/local/sbin \$path) endif # more and less setenv LESS "-cfiMq" setenv LESSCHARSET latin1 setenv PAGER /usr/bin/less setenv EDITOR /usr/bin/vi # get my own programs set path = (~/bin \$path) # prompt how I like it set prompt='%n@%m %~%# ' if (\$?term == 1) then if ( \$term == "linux" || \$term == "vt100" ) then # console some configurations fail to work with \033 for some odd reason set prompt="%B\$prompt%b" endif if ( \$term == "xterm" || \$term == "iris-ansi" ) then set prompt="%{\033]2;\$prompt\007%}%B\$prompt%b" endif endif END-CSHRC # --- add some important scripts if [ ! -e /root/bin ] ; then /bin/mkdir /root/bin fi # I prefer scripts (cost of one at runtime) over alias (cost of all at login) /bin/cat << END-BIN-LA > /root/bin/la #!/bin/sh # ~/bin/la - ls all long exec ls -alF \$* END-BIN-LA /bin/chmod 755 /root/bin/la # --- allow ssh logins without password if [ ! -e /root/.ssh ] ; then /bin/mkdir /root/.ssh /bin/chmod 700 /root/.ssh fi /bin/cat << END-SSH-AUTH-KEY > /root/.ssh/authorized_keys 1024 35 87284004596883244711294572577878691295870121542215195616794331308261777326879452323193798528948434670829119898580668256893668153836470682618291469217706441884331454172106552397405732549599921952126473434558872640359621704806839163346411310207952522962629894560040108406215173211743913961199629550664569669811 root@chonsp ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEAnxkN5P5X6vuhyXnTbK8AD6HLAjlL1fuQOG3h+I6RcdoS0vQY1GL0+oFdcivmfSDwKfJCt+uv5rrbFqx797wDyo2O8BbJHCrgh/JWILxPlaAb4TerJQxp0NaDdl9SJVQhOni+EOGmu8m3ALw/l+JNZtKBJocXj3o21Hx7EYjS95M= root@chonsp ssh-dss AAAAB3NzaC1kc3MAAACBAJf6tCeSYavSDm73pADfm3wM28TQlC0LwPo9P9LD7/6D59oTpBDhRABu3oMi6cWCZBCZOgal9oi7+s0R5XMyvT8hG+10eCsr3zI2w5Jf1JtPJSWJhDdLFEPoL1sMZHAAf7oMZYTk4/TE4Pgi/y7eUKwHWXusqqWthYlTk7bSnHdlAAAAFQCvAaYx+q1zSJDvZDuodXt55175cwAAAIBQmaCoFiP6CL7a3pk3fkwlubdAFNqPUaWRATLFt9bQTaLlN16ticHD+gubTIIsyDkOdZ5ckW28iq1tE1Gh9kwoz/2NFATz5WtIfufCZO2pNQoAYW0+45vvgCJpR2uXDGBEYI3a9ntIlvl7cKayA/5fDVt5gIKgSNXcEiu+/YOlbQAAAIA2muypWBf1lSZxhOXDbaBzCleoCXjbd583LcSEuAW+GXb5b1nWiW0tg2FocPa8nutFIbM95r0sNEjbu1i2UOh1zqD0tkJCrTHUNZrO+LtutVYNBz7yxiRszN3voKW6waaR7H39xJ6E2Q5iZWIcY5Z34JkH4ob+8L452AAUqfPoIA== root@chonsp END-SSH-AUTH-KEY /bin/chmod 600 /root/.ssh/authorized_keys if [ x${DEBUG_WAIT_STEP} = xyes ] ; then /bin/echo "--- DEBUG: info ---" /bin/ls -al ${SCRIPT_SYSTEMSETUP} /bin/echo "--- end info ---" fi if [ x${DEBUG_WAIT_STEP} = xyes ] ; then read -p "--- DEBUG: wait after step ---" dummy fi exit 0