Benutzer-Werkzeuge

Webseiten-Werkzeuge


projects:raspberrypi:install

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen der Seite angezeigt.

Link zu der Vergleichsansicht

Beide Seiten, vorherige ÜberarbeitungVorherige Überarbeitung
Nächste Überarbeitung
Vorherige Überarbeitung
projects:raspberrypi:install [2015/06/04 21:27] benhprojects:raspberrypi:install [2016/10/22 17:46] (aktuell) benh
Zeile 1: Zeile 1:
-====== Howto configure a basic debian server on a Raspberry Pi ======+/op====== Howto configure a basic debian server on a Raspberry Pi ======
 ===== Requirements ===== ===== Requirements =====
   * Raspberry Pi & power supply   * Raspberry Pi & power supply
Zeile 17: Zeile 17:
       - Memory Split - set to "16"       - Memory Split - set to "16"
       - Update       - Update
-  - update firmware <code bash>rpi-update</code>+  - update firmware <code bash>apt-get install rpi-update && rpi-update</code>
   - reboot the Raspberry Pi <code bash>reboot</code>   - reboot the Raspberry Pi <code bash>reboot</code>
   - login through ssh console <code bash>ssh pi@10.{x}.{x}.{x}</code>   - login through ssh console <code bash>ssh pi@10.{x}.{x}.{x}</code>
Zeile 26: Zeile 26:
   - update package repositories <code bash>apt-get update</code>   - update package repositories <code bash>apt-get update</code>
   - upgrade all packages to newest version <code bash>apt-get dist-upgrade</code>   - upgrade all packages to newest version <code bash>apt-get dist-upgrade</code>
-  - enable watchdog kernel module <code bash>echo "bcm2708_wdog" | sudo tee -a /etc/modules && modprobe bcm2708_wdog</code> +  - enable watchdog kernel module (history: bcm2708_wdog) <code bash>echo "bcm2835_wdt" | sudo tee -a /etc/modules && modprobe bcm2835_wdt</code> 
-  - install additional packets <code bash> apt-get install vim-nox dnsmasq htop iftop nmap exim4-daemon-light uptimed dnsutils wget curl ntpdate mc fail2ban logwatch apticron watchdog git locate</code>+  - install additional packets <code bash> apt-get install vim-nox dnsmasq htop iftop nmap exim4-daemon-light uptimed dnsutils wget curl ntpdate mc fail2ban logwatch apticron watchdog git locate figlet lsb-release</code>
   - add new user <code bash>adduser benh</code>   - add new user <code bash>adduser benh</code>
   - change console to new user <code bash>su - benh</code>   - change console to new user <code bash>su - benh</code>
Zeile 44: Zeile 44:
   - replace bashrc "[[projects:raspberrypi:bashrc|/etc/ssh/bashrc]]" <code bash>vi .bashrc</code>    - replace bashrc "[[projects:raspberrypi:bashrc|/etc/ssh/bashrc]]" <code bash>vi .bashrc</code> 
   - configure hosts file <code bash>vi /etc/hosts</code>   - configure hosts file <code bash>vi /etc/hosts</code>
-    - comment the hostname->localhost line <code>#127.0.1.1       obadja.b9h.de</code> +    - comment the hostname->localhost line <code>#127.0.1.1       xyz.b9h.de</code> 
-    - add a line with hostname->ip <code>10.{x}.0.200    obadja.b9h.de obadja.localnet obadja</code>+    - add a line with hostname->ip <code>10.{x}.0.200    xyz.b9h.de xyz.localnet xyz</code>
   - add ssh login notification script "[[https://git.benhartmann.de/small-scripts/.git/blob/HEAD:/sshrc|/etc/ssh/sshrc]]" <code bash>vi /etc/ssh/sshrc</code>   - add ssh login notification script "[[https://git.benhartmann.de/small-scripts/.git/blob/HEAD:/sshrc|/etc/ssh/sshrc]]" <code bash>vi /etc/ssh/sshrc</code>
   - redirect root mails to operator <code bash>echo -e "root: operator\noperator: [email protected]" >> /etc/aliases && newaliases</code>   - redirect root mails to operator <code bash>echo -e "root: operator\noperator: [email protected]" >> /etc/aliases && newaliases</code>
Zeile 57: Zeile 57:
 echo -e "`hostname --fqdn`\n`date`\nsystem is running" | mail -s"`hostname --fqdn` - system is running" operator</code> echo -e "`hostname --fqdn`\n`date`\nsystem is running" | mail -s"`hostname --fqdn` - system is running" operator</code>
   - set correct mailname <code bash>vi /etc/mailname</code><code>b9h.de #remove the hostname</code>   - set correct mailname <code bash>vi /etc/mailname</code><code>b9h.de #remove the hostname</code>
 +  - set correct recipient for logwatch mails <code bash>vi /etc/cron.daily/00logwatch</code>
   - hardening proc filesystem (hide foreign processes from normal users)<code bash>vi /etc/fstab</code><code>proc                    /proc                   proc    defaults,hidepid=2        0 0</code>   - hardening proc filesystem (hide foreign processes from normal users)<code bash>vi /etc/fstab</code><code>proc                    /proc                   proc    defaults,hidepid=2        0 0</code>
   - configure motd "[[projects:raspberrypi:00-header|00-header]] [[projects:raspberrypi:10-sysinfo|10-sysinfo]]" <code bash>mkdir /etc/update-motd.d   - configure motd "[[projects:raspberrypi:00-header|00-header]] [[projects:raspberrypi:10-sysinfo|10-sysinfo]]" <code bash>mkdir /etc/update-motd.d
Zeile 64: Zeile 65:
 vi /etc/update-motd.d/10-sysinfo vi /etc/update-motd.d/10-sysinfo
 echo -ne '#!/bin/sh\nuname -snrvm' > /etc/update-motd.d/10uname echo -ne '#!/bin/sh\nuname -snrvm' > /etc/update-motd.d/10uname
 +rm /etc/motd.tail && echo > /etc/motd.tail
 echo -ne '#!/bin/sh\n[ ! -f /etc/motd.tail ] && exit 0\ncat /etc/motd.tail' > /etc/update-motd.d/20tail echo -ne '#!/bin/sh\n[ ! -f /etc/motd.tail ] && exit 0\ncat /etc/motd.tail' > /etc/update-motd.d/20tail
 chmod a+x /etc/update-motd.d/*</code> chmod a+x /etc/update-motd.d/*</code>
  
projects/raspberrypi/install.1433446043.txt.gz · Zuletzt geändert: von benh