Sysadmin > FreeBSD > FreeBSDAfterboot

FreeBSD afterboot

  • config domain and nameserver in /etc/resolv.conf
  • touch CHANGES, TODO, EXPL
    • date "+%d %b %Y" = 25 Nov 2018
    • uname -a | awk '{print $4,$5,$6}' = FreeBSD 12.0-PRERELEASE r340490

  • add normal user (ssh) to wheel
  • sshd with root and another port
  • if ApU: SerialWithPcenginesAPU
  • proxy-config in //etc/csh.cshrc and /etc/profile
  • ntp viewtopic
    • ntpdate 192.168.111.13
    • server
    • leapsecond
    • .. wip
  • add CHANGES log
  • add TODO
  • add EXPL example commands viewtopic
  • freebsd pkg
    • pkg update
    • pkg install vim-lite
    • ... basic tools via pkg ...
    • pkg info # list installed packages
  • add handbook
    • pkg install en-freebsd-doc
    • pkg install de-freebsd-doc
    • add alias for handbook alias handbook  w3m /usr/local/share/doc/freebsd/de/books/handbook/book.html in .cshrc
  • pkgsrc (preferred tp freebsd ports) viewtopic
    • zfs create -o compress=lz4 -o mountpoint=/usr/pkgsrc -o quota=30G zroot/usr/pkgsrc
    • cd /usr
    • fetch ftp://ftp.netbsd.org/pub/pkgsrc/stable/pkgsrc.tar.xz
    • tar xvfJ pkgsrc.tar.xz
    • cd /usr/pkgsrc/bootstrap/
    • ./bootstrap --pkgdbdir /opt/pkg/db/pkg --prefix /opt/pkg --sysconfdir /opt/pkg/etc --workdir=/tmp/work --varbase /var/pkg
    • edit mk.conf
      • add PACKAGES= /opt/packages
      • add DISTDIR= /opt/distfiles
    • add pkgsrc to path setenv PATH /opt/pkg/sbin:/opt/pkg/bin:$PATH
    • add PATH to .cshrc
    • add fetch alterts to cron
    • add pkgsrc-update.sh
    • add
      • echo "ACCEPTABLE_LICENSES+= vim-license" >> /opt//pkg/etc/mk.conf
      • vim
      • devel/scmcvs
      • devel/subversion-base
      • misc/tmux *
      • lsof
      • screen
      • ansible
      • w3m, ...
      • pkgtools/pkgclean
  • /usr/src
    • svn co svn://svn.freebsd.org/base/stable/11 /usr/src
    • #svn checkout https://svn.freebsd.org/base/head /usr/src
    • svn update /usr/src
    • check /usr/src/UPDATING
    • cd /usr/src
    • make -j4 buildworld
    • make -j4 buildkernel
    • make installkernel
    • shutdown -r now
    • cd /usr/src
    • make installworld
    • mergemaster -Ui
    • shutdown -r now
  • ~/bin viewtopic
  • set up a better crypto algorithm
    • edit /etc/login.conf
    • replace :passwd_format=sha512:\ with :passwd_format=blf:\
    • use passwd to rewrite the password
  • boot environment wip
  • check hash algo (obsolet)
  • create locate database
  • configure sshd (root, port, keys) and tighten security

obsolet

  • change password hash algo in /etc/login.conf

Update the ports tree
portsnap fetch update
Eventually upgrade pkg
cd /usr/ports/ports-mgmt/pkg; make install clean
Then convert your /var/db/pkg database to the new pkg format
pkg2ng
Install update tool
cd /usr/ports/ports-mgmt/portmaster; make install clean
List categories and search for updates
portmaster -L
upgrade all outdated ports
portmaster -a