Advertisement
Guest User

Ian Sealy

a guest
Sep 20th, 2010
567
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 10.90 KB | None | 0 0
  1. # Running lenny or squeeze on a Bubba Two
  2. # =======================================
  3.  
  4. # These are just my notes - some details are specific to me
  5. # For example, my router always assigns the LAN port to 192.168.0.140 and the WAN port to 192.168.0.141
  6. # Plus I'm based in the UK, so I'm using a UK Debian mirror and some UK packages like wbritish
  7.  
  8. # Do standard installation according to http://download.excito.net/web/BubbaTwo/UM-ENG/install.html using recovery image from http://update.excito.net/install/bubba-two/image-1.2/b2-install-1.2.zip (i.e. not the latest)
  9. # Summary: Unzip recovery image to USB key; shut down Bubba; remove power; insert USB key; connect WAN port to router; hold power button; plug in power; wait 5 seconds before releasing power button; wait until LED stops flashing
  10. # Power down; remove USB key; connect LAN port to router; power up
  11. # Go to 192.168.0.140/admin/ and login as username admin with password admin
  12. # Choose timezone
  13. # Add user with username temp who can login via SSH
  14. # Leave network profile as server mode only
  15.  
  16. # SSH to Bubba
  17. ssh temp@192.168.0.140
  18.  
  19. # su to root (password excito)
  20. su -
  21.  
  22. # Remove packages (accepting default answers to package configuration questions, except for configuring mysql-server-5.0, where all databases should be removed)
  23. aptitude purge apache2.2-common apache2-mpm-prefork apache2-utils avahi-daemon bubba-album bubba-apt bubba-backend bubba-diskmanager bubba-frontend bubba-horde bubba-manual ca-certificates cracklib2 cupsys cupsys-client cupsys-common dbconfig-common dbus defoma dimp1-base dnsmasq dovecot-common dovecot-imapd duplicity epeg expect fetchmail filetransferdaemon fireplay flac fontconfig-config gs-common gs-esp gsfonts horde3-base imp4-base kronolith2-base libalgorithm-c3-perl libapache2-mod-fastcgi libapache2-mod-php5 libappconfig-perl libapr1 libaprutil1 libarchive-tar-perl libarchive-zip-perl libasn1-6-heimdal libasound2 libavahi-client3 libavahi-common3 libavahi-common-data libavahi-core4 libavcodec51 libavformat52 libavutil49 libcache-cache-perl libcarp-assert-perl libcarp-clan-perl libc-client2007b libcgi-fast-perl libcgi-pm-perl libclass-accessor-chained-perl libclass-accessor-perl libclass-c3-perl libclass-data-accessor-perl libclass-data-inheritable-perl libclass-inspector-perl libclass-trigger-perl libclass-virtual-perl libclass-xsaccessor-array-perl libcompress-zlib-perl libcrypt-passwdmd5-perl libcupsimage2 libcupsys2 libcurl3 libcurl3-gnutls libdata-dump-perl libdata-page-perl libdata-uriencode-perl libdbd-mysql-perl libdbi-perl libdbix-class-perl libdbix-contextualfetch-perl libdbus-1-3 libdigest-hmac-perl libdigest-sha1-perl libencode-detect-perl libenum-perl libepeg0 liberror-perl libeutils0 libexif12 libexpat1 libexpect-perl libexporter-lite-perl libextutils-cbuilder-perl libextutils-parsexs-perl libfaad0 libfcgi-perl libfile-bom-perl libfile-next-perl libfile-slurp-perl libfile-temp-perl libfile-type-perl libfile-which-perl libfilter-perl libflac7 libfontconfig1 libfreetype6 libgd2-xpm libgd-gd2-perl libgetopt-argvfile-perl libglib2.0-0 libgsm1 libgssapi4-heimdal libhtml-parser-perl libhtml-tagset-perl libhtml-tree-perl libice6 libid3tag0 libimage-exiftool-perl libio-pty-perl libio-string-perl libio-stringy-perl libio-stty-perl libio-zlib-perl libipc-run3-perl libipc-sharelite-perl libjpeg62 libjson-perl libjson-xs-perl libjson-xs-versiononeandtwo-perl libjs-prototype libjs-scriptaculous libkrb5-17-heimdal liblog-log4perl-perl libltdl3 libmad0 libmath-vecstat-perl libmcrypt4 libmodule-build-perl libmodule-find-perl libmodule-scandeps-perl libmozjs0d libmpcdec6 libmysqlclient15off libnet-daemon-perl libnet-dns-perl libnet-ip-perl libnet-upnp-perl libnspr4-0d libogg0 liboggflac3 libossp-uuid15 libossp-uuid-perl libpaper1 libpar-dist-perl libpar-perl libpath-class-perl libperl6-say-perl libphp-codeigniter libplrpc-perl libpng12-0 libpoe-perl libpoe-xs-queue-array-perl libpoppler0c2 libpq4 libproc-background-perl libreadonly-perl libreplaygain1 libroken16-heimdal librsync1 libsasl2 libsasl2-modules libslp1 libsm6 libsql-abstract-limit-perl libsql-abstract-perl libssh2-1 libsub-uplevel-perl libt1-5 libtag1c2a libtagc0 libtemplate-perl libtest-exception-perl libtext-unidecode-perl libtheora0 libtie-cache-lru-expires-perl libtie-cache-lru-perl libtie-ixhash-perl libtie-llhash-perl libtie-regexphash-perl libtiff4 libtimedate-perl libuniversal-exports-perl libuniversal-require-perl liburi-find-perl liburi-perl libversion-perl libvorbis0a libvorbisenc2 libvorbisfile3 libwavpack0 libwww-perl libx11-6 libx11-data libxau6 libxdmcp6 libxext6 libxml-libxml-common-perl libxml-libxml-perl libxml-namespacesupport-perl libxml-parser-perl libxml-sax-perl libxml-simple-perl libxpm4 libxt6 libyaml-perl libyaml-syck-perl lighttpd-spawnfcgi mdadm mediatomb-common mediatomb-daemon mlock mnemo2-base mt-daapd musepack-tools mysql-client-5.0 mysql-common mysql-server mysql-server-5.0 ncftp netatalk netcat ntp php5-cgi php5-cli php5-common php5-gd php5-imap php5-mcrypt php5-mysql php5-xcache php-date php-db php-file php-http-request php-log php-mail php-mail-mime php-mdb2 php-mdb2-driver-mysql php-mdb2-schema php-net-imap php-net-socket php-net-url php-pear poppler-utils proftpd samba samba-common sox squeezecenter tcl8.4 ttf-dejavu ttf-freefont turba2-base wavpack x11-common zip
  24.  
  25. # Switch to lenny
  26. cp /etc/apt/sources.list /etc/apt/sources.list.orig
  27. echo 'deb http://ftp.uk.debian.org/debian/ lenny main
  28. deb http://security.debian.org/ lenny/updates main
  29. deb http://volatile.debian.org/debian-volatile lenny/volatile main
  30. deb http://update.excito.org/ marielle main' > /etc/apt/sources.list
  31.  
  32. # Ensure essential Excito packages are upgraded
  33. cp /etc/apt/preferences /etc/apt/preferences.orig
  34. echo 'Package: *
  35. Pin: release o=Excito, origin "update.excito.org"
  36. Pin-Priority: 50
  37. Package: bubba-kernel
  38. Pin: release o=Excito, origin "update.excito.org"
  39. Pin-Priority: 1000
  40. Package: bubba-modules
  41. Pin: release o=Excito, origin "update.excito.org"
  42. Pin-Priority: 1000
  43. Package: bubba-status
  44. Pin: release o=Excito, origin "update.excito.org"
  45. Pin-Priority: 1000
  46. Package: excito-keyring
  47. Pin: release o=Excito, origin "update.excito.org"
  48. Pin-Priority: 1000
  49. Package: libeutils1
  50. Pin: release o=Excito, origin "update.excito.org"
  51. Pin-Priority: 1000' > /etc/apt/preferences
  52.  
  53. # Upgrade packages to lenny (again, accepting default answers to package configuration questions, except for /etc/lvm/lvm.conf, where package maintainer's version should be installed)
  54. aptitude update
  55. aptitude dist-upgrade
  56.  
  57. # Install remaining lenny standard system packages (choose british as system's default ispell dictionary and system's default wordlist)
  58. aptitude install at bash-completion bc bind9-host bsd-mailx busybox console-common console-data console-tools dc debian-faq dictionaries-common dnsutils doc-debian doc-linux-text eject exim4 exim4-base exim4-config exim4-daemon-light ftp gcc-4.2-base gettext-base iamerican ibritish initramfs-tools installation-report iproute ispell klibc-utils less libbind9-40 libbind9-50 libc6-ppc64 libcap2 libdns45 libdns55 libevent1 libgc1c2 libgnutls26 libgpm2 libgssglue1 libisc45 libisc52 libisccc40 libisccc50 libisccfg40 libisccfg50 libklibc libldap-2.4-2 liblockfile1 liblwres40 liblwres50 libnfsidmap2 libpci3 librpcsecgss3 locales lsof m4 mac-fdisk mlocate mutt ncurses-term netcat-traditional nfs-common pciutils portmap procmail reportbug rsyslog telnet texinfo time usbutils util-linux-locales w3m wamerican wbritish whois
  59.  
  60. # Remove packages that aren't part of lenny standard system
  61. aptitude purge ca-certificates ethtool gcc-4.1-base klogd libatm1 libcap1 libdb4.2 libdb4.3 libdb4.4 libdevmapper1.02 libgnutls13 libldap2 liblzo1 libopencdk8 locales-all lvm-common openssl openssl-blacklist postfix psmisc python2.4 python2.4-minimal python-gnupginterface python-pexpect python-support ssl-cert sysklogd
  62.  
  63. # Packages in lenny standard system that aren't installed
  64. # linux-image-2.6.26-2-powerpc
  65. # linux-image-2.6-powerpc
  66. # quik
  67. # yaboot
  68.  
  69. # Packages that aren't in lenny standard system that are still installed:
  70. # bubba-kernel
  71. # bubba-modules
  72. # bubba-status
  73. # excito-keyring
  74. # ifplugd
  75. # libdaemon0
  76. # openssh-blacklist
  77. # openssh-server
  78.  
  79. # Delete some config files, logs and customisations
  80. rm -rf /etc/apache2/
  81. rm /etc/default/apache2
  82. rm -rf /etc/php5/
  83. rmdir /etc/skel/private/ /etc/skel/torrents/
  84. rm -rf /home/web/ /home/storage/
  85. rm -rf /var/lib/apache2/ /var/log/apache2/
  86. rm /tmp/bubba-apt.log
  87. perl -spi -e 's/umask 000/umask 022/' /etc/profile
  88.  
  89. # Regenerate SSH keys
  90. rm /etc/ssh/ssh_host_*
  91. dpkg-reconfigure openssh-server
  92.  
  93. # Change default root password, remove admin and temp users and create new user
  94. passwd
  95. deluser --remove-home admin
  96. adduser myusername
  97. # Log out as temp and login as myusername and then su to root (password excito)
  98. exit
  99. exit
  100. ssh 192.168.0.140
  101. su -
  102. deluser --remove-home temp
  103.  
  104. # Only allow myusername to SSH
  105. perl -spi -e 's/DenyUsers admin/AllowUsers myusername/' /etc/ssh/sshd_config
  106. /etc/init.d/ssh reload
  107.  
  108. # Compile your locale
  109. dpkg-reconfigure locales
  110.  
  111. # Log out
  112. exit
  113. exit
  114. # Power down; connect WAN port to router; power up
  115.  
  116. # Now have lenny standard system, but can carry on and upgrade to squeeze if desired
  117.  
  118. # Switch to squeeze
  119. ssh 192.168.0.141
  120. su -
  121. echo 'deb http://ftp.uk.debian.org/debian/ squeeze main
  122. deb http://security.debian.org/ squeeze/updates main
  123. deb http://update.excito.org/ marielle main' > /etc/apt/sources.list
  124.  
  125. # Upgrade packages to squeeze (again, accepting default answers to package configuration questions, and accepting solution for aptitude dist-upgrade)
  126. aptitude update
  127. aptitude install apt dpkg aptitude
  128. aptitude upgrade
  129. aptitude dist-upgrade
  130.  
  131. # Install remaining squeeze standard system packages
  132. aptitude install apt-listchanges ca-certificates console-setup console-terminus discover discover-data host kbd keyboard-configuration libdb4.5 libdb4.6 libdiscover2 libexpat1 libgssrpc4 libkadm5clnt-mit7 libkadm5srv-mit7 libkdb5-4 libuuid-perl libx11-6 libx11-data libxau6 libxcb1 libxdmcp6 libxext6 libxmuu1 make openssh-blacklist-extra openssl psmisc sgml-base xauth xkb-data xml-core console-tools_
  133.  
  134. # Remove packages that aren't part of squeeze standard system
  135. aptitude purge apt-xapian-index console-common console-data dhcp3-common diff ed gcc-4.2-base gcc-4.3-base iamerican libbind9-40 libbind9-50 libconsole libdns45 libdns55 libept0 libevent1 libfile-copy-recursive-perl libisc45 libisc52 libisccc40 libisccc50 libisccfg40 libisccfg50 libkrb53 liblwres40 liblwres50 libvolume-id0 libxapian15 makedev mktemp openbsd-inetd python2.5 python2.5-minimal python-chardet python-debian python-xapian update-inetd usbutils
  136.  
  137. # Packages in squeeze standard system that aren't installed
  138. # linux-base
  139. # linux-image-2.6.32-5-powerpc
  140. # linux-image-2.6-powerpc
  141. # quik
  142. # yaboot
  143.  
  144. # Packages that aren't in squeeze standard system that are still installed:
  145. # bubba-kernel
  146. # bubba-modules
  147. # bubba-status
  148. # excito-keyring
  149. # ifplugd
  150. # libdaemon0
  151. # openssh-server
  152.  
  153. # Now have squeeze standard system
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement