3 | | ==== Encrypted File system ==== |
| 4 | == Syn Cookies == |
| 5 | |
| 6 | * Enable syncookies: |
| 7 | |
| 8 | {{{ |
| 9 | echo 1 > /proc/sys/net/ipv4/tcp_syncookies |
| 10 | }}} |
| 11 | |
| 12 | * Preserve syncookies on reboot: |
| 13 | |
| 14 | {{{ |
| 15 | echo 'net.ipv4.tcp_syncookies=1' >> /etc/sysctl.conf |
| 16 | }}} |
| 17 | |
| 18 | == Install and configure mandatory packages == |
| 19 | |
| 20 | * Login as root and install the following packages (if you plan to install postfix, replace esmtp-run with postfix) |
| 21 | |
| 22 | {{{ |
| 23 | # aptitude install ssh ntp less emacs21-nox cron-apt iproute mailx esmtp-run locales |
| 24 | }}} |
| 25 | |
| 26 | * Configure locales to use en_US.UTF-8 (run dpkg-reconfigure locales if necessary) |
| 27 | |
| 28 | * If you installed esmtp-run, edit /etc/esmtprc, configure to send email via our bulk.mayfirst.org server (which relays all mail from our IP range): |
| 29 | |
| 30 | {{{ |
| 31 | hostname=bulk.mayfirst.org |
| 32 | }}} |
| 33 | |
| 34 | * Configure cron-apt: |
| 35 | {{{ |
| 36 | echo 'MAILON="upgrade"' >> /etc/cron-apt/config |
| 37 | }}} |
| 38 | |
| 39 | * Upload the [wiki:mfpl_admin_public_ssh_keys mayfirst public keys] to: |
| 40 | |
| 41 | {{{ |
| 42 | /root/.ssh/authorized_keys |
| 43 | }}} |
| 44 | |
| 45 | * Configure ssh to only accept connections with auth keys (unless this is a server that should be accessible by members). Edit /etc/ssh/sshd_config and uncomment/change these lines: |
| 46 | |
| 47 | {{{ |
| 48 | PasswordAuthentication no |
| 49 | ChallengeResponseAuthentication no |
| 50 | }}} |
| 51 | |
| 52 | * Reload ssh: |
| 53 | |
| 54 | {{{ |
| 55 | # /etc/init.d/ssh reload |
| 56 | }}} |
| 57 | |
| 58 | == Fix Bash == |
| 59 | |
| 60 | * Overwrite /root/.bashrc with: |
| 61 | {{{ |
| 62 | # ~/.bashrc: executed by bash(1) for non-login shells. |
| 63 | |
| 64 | export PS1='$? \h:\w\$ ' |
| 65 | umask 022 |
| 66 | |
| 67 | # You may uncomment the following lines if you want `ls' to be colorized: |
| 68 | # export LS_OPTIONS='--color=auto' |
| 69 | # eval "`dircolors`" |
| 70 | # alias ls='ls $LS_OPTIONS' |
| 71 | # alias ll='ls $LS_OPTIONS -l' |
| 72 | # alias l='ls $LS_OPTIONS -lA' |
| 73 | # |
| 74 | # Some more alias to avoid making mistakes: |
| 75 | alias rm='rm -i' |
| 76 | alias cp='cp -i' |
| 77 | alias mv='mv -i |
| 78 | }}} |
| 79 | |
| 80 | * Modify the following lines in /etc/skel/.bashrc |
| 81 | {{{ |
| 82 | PS1='$? ${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' |
| 83 | ;; |
| 84 | *) |
| 85 | PS1='$? ${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' |
| 86 | }}} |
| 87 | |
| 88 | * Add a .ssh directory and empty authorized_keys file in /etc/skel: |
| 89 | {{{ |
| 90 | mkdir /etc/skel/.ssh |
| 91 | touch /etc/skel/.ssh/authorized_keys |
| 92 | }}} |
| 93 | |
| 94 | == Serial console login (not for DomU's, only dom0's!) == |
| 95 | |
| 96 | If you did not use the serial console installer, then perform the following: |
| 97 | |
| 98 | * Edit the /etc/inittab file. Uncomment and modify: |
| 99 | |
| 100 | {{{ |
| 101 | T0:23:respawn:/sbin/getty -L ttyS0 115200 vt100 |
| 102 | }}} |
| 103 | |
| 104 | * Refresh: |
| 105 | |
| 106 | {{{ |
| 107 | $ sudo init q |
| 108 | }}} |
| 109 | |
| 110 | * Add the following lines after the timeout line in `/boot/grub/menu.1st` |
| 111 | |
| 112 | {{{ |
| 113 | serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1 |
| 114 | terminal --timeout=10 serial console |
| 115 | }}} |
| 116 | |
| 117 | * Add the following lines to the Start Default Options. You should already have a line such as: |
| 118 | |
| 119 | {{{ |
| 120 | # kopt=root=/dev/mapper/vg_servername0-root ro |
| 121 | }}} |
| 122 | |
| 123 | add to it, so that your final line says: |
| 124 | |
| 125 | {{{ |
| 126 | # kopt=root=/dev/mapper/vg_servername0-root ro console=ttyS0,115200n8 |
| 127 | }}} |
| 128 | |
| 129 | Refresh grub's config file: |
| 130 | |
| 131 | {{{ |
| 132 | # update-grub |
| 133 | }}} |
| 134 | |
| 135 | |
| 136 | === Encrypted File system === |