{"id":164,"date":"2015-09-17T18:08:53","date_gmt":"2015-09-17T18:08:53","guid":{"rendered":"http:\/\/coolt.ch\/notizen\/?p=164"},"modified":"2015-09-28T19:23:00","modified_gmt":"2015-09-28T19:23:00","slug":"debian-auf-raspberry-pi-2","status":"publish","type":"post","link":"https:\/\/coolt.ch\/notizen\/debian-auf-raspberry-pi-2\/","title":{"rendered":"debian auf raspberry pi 2"},"content":{"rendered":"<p><strong>Debian auf SD-Karte laden<\/strong><\/p>\n<ul>\n<li>Debian Jessie image f\u00fcr Pi 2:\u00a0<a href=\"http:\/\/sjoerd.luon.net\/posts\/2015\/02\/debian-jessie-on-rpi2\/\">http:\/\/sjoerd.luon.net\/posts\/2015\/02\/debian-jessie-on-rpi2\/<\/a><\/li>\n<li>Erh\u00e4lt Raspery Pi mit SD Karte strom, bootet das System von selbst<\/li>\n<\/ul>\n<p><a href=\"http:\/\/sjoerd.luon.net\/posts\/2015\/02\/debian-jessie-on-rpi2\/#comment-99a98c5d7f6de7cbd3b5513cd25caa96\">Schritte<\/a> von Juan:<\/p>\n<ol>\n<li>Download and extract the jessie-rpi2-*.img.gz to get an .img file<\/li>\n<li>On any debian-based linux type <span class=\"lang:sh decode:true crayon-inline \">sudo apt-get install bmap-tools<\/span>\u00a0 and install it.<\/li>\n<li>Then type <span class=\"lang:sh decode:true crayon-inline\">sudo bmaptool copy &#8211;nobmap jessie-rpi2.img \/dev\/sdx<\/span>\u00a0 (Change yourlocation to the location of the .img file and sdx for the letter where the SD is mounted, if you don&#8217;t know it type <span class=\"lang:sh decode:true crayon-inline\">sudo fdisk -l<\/span>\u00a0 and look for it).<\/li>\n<li>Wait until it finishes and then put the SD on your rp2.<\/li>\n<\/ol>\n<p><strong>Erster SSH-Login zum Konfigurieren<br \/>\n<\/strong><\/p>\n<ul>\n<li>Das\u00a0RPi durch Ethernet mit dem\u00a0Router verbinden\u00a0und dann am Strom anschliesen zum\u00a0booten.<\/li>\n<li>Auf dem Router pr\u00fcfen, welche \u00a0IP-Adresse das RPi bekommen hat (durch Namen der Maschine)<\/li>\n<li><span class=\"lang:sh decode:true crayon-inline\">$ ssh root@192.168.1.158<\/span>\u00a0mit Passwort <span class=\"lang:sh decode:true crayon-inline \">debian<\/span><\/li>\n<\/ul>\n<p><strong>Grundsystem konfigurieren<\/strong><\/p>\n<ul>\n<li>Kontos f\u00fcr ale und katrin erstellen. Login ohne Passwort, nur mit key.\n<ul>\n<li><span class=\"lang:sh decode:true crayon-inline \">adduser katrin<\/span>\u00a0 (+ale)<\/li>\n<li>auf Linux, SSH-key generieren: <span class=\"lang:sh decode:true crayon-inline \">ssh-keygen<\/span>\u00a0 (fragt um ein Pfad)<\/li>\n<li><span class=\"lang:sh decode:true crayon-inline \">scp id_rsa.pub katrin@192.168.1.158:.ssh\/<\/span>\u00a0 (+ale)<\/li>\n<li>auf den rpi: <span class=\"lang:sh decode:true crayon-inline \">cat id_rsa.pub &gt;&gt; .ssh\/authorized_keys<\/span><\/li>\n<li>Zugangsrechte f\u00fcr <span class=\"lang:sh decode:true crayon-inline \">~.ssh\/*<\/span>\u00a0 auf <span class=\"lang:sh decode:true crayon-inline \">r&#8211;<\/span>\u00a0 setzen<\/li>\n<\/ul>\n<\/li>\n<li>kein login f\u00fcr root und nur key login f\u00fcr den users:\n<ul>\n<li>edit <span class=\"lang:sh decode:true crayon-inline \">\/etc\/ssh\/ssh_config<\/span>\u00a0,<\/li>\n<li><span class=\"lang:sh decode:true crayon-inline \">PasswordAuthentication no<\/span>\u00a0 und <span class=\"lang:sh decode:true crayon-inline \">PermitRootLogin no<\/span>\u00a0\u00a0setzen.<\/li>\n<\/ul>\n<\/li>\n<li>Auf dem Router, Port forwarding f\u00fcr https einrichten<\/li>\n<\/ul>\n<p><strong>Owncloud installieren<\/strong><\/p>\n<ul>\n<li>die externe festplatte in <span class=\"lang:sh decode:true crayon-inline \">\/etc\/fstab<\/span>\u00a0 hinzuf\u00fcgen\n<ul>\n<li>die uuid der festplatte mit <span class=\"lang:sh decode:true crayon-inline \">blkid<\/span>\u00a0 auslesen<\/li>\n<li>in \/etc\/fstab die folgende Zeile hinzuf\u00fcgen:<br \/>\n<span class=\"lang:sh decode:true crayon-inline\">UUID=375cae2c-e89e-45ef-80f3-ee65e54b27e2 \/mnt\/data ext4 defaults 0 2<\/span><\/li>\n<li><span class=\"lang:sh decode:true crayon-inline\">ln -s \/mnt\/data\/owncloud \/var\/www\/owncloud\/data<\/span>\u00a0 (falls <span class=\"lang:sh decode:true crayon-inline\">data\/<\/span>\u00a0bereits\u00a0exisitert, zuerst umbennen und dann den inhalt in den neuen <span class=\"lang:sh decode:true crayon-inline \">data\/<\/span>\u00a0 verzeichnis kopieren; es scheint nicht m\u00f6glich zu sein, auf andere laufwerke zugreifen)<\/li>\n<\/ul>\n<\/li>\n<li>user <span class=\"lang:sh decode:true crayon-inline \">owncloud<\/span>\u00a0 in der datenbank hinzuf\u00fcgen:<br \/>\n<span class=\"lang:sh decode:true crayon-inline\">$ mysql &#8211;user=root &#8211;password mysql<\/span><br \/>\n<span class=\"lang:mysql decode:true crayon-inline \">create user &#8218;owncloud&#8217;@&#8217;localhost&#8216; identified by &#8218;owncloud&#8216;\u00a0WITH GRANT OPTION;<\/span><span class=\"lang:mysql decode:true crayon-inline\"><br \/>\nGRANT ALL PRIVILEGES ON *.* TO &#8218;owncloud&#8217;@&#8217;localhost&#8216;;<\/span><br \/>\n<span class=\"lang:sh decode:true crayon-inline\">SELECT User FROM mysql.user;<\/span><br \/>\n<span class=\"lang:sh decode:true crayon-inline \">create database owncloud;<\/span><\/li>\n<li><a href=\"https:\/\/software.opensuse.org\/download\/package?project=isv:ownCloud:community&amp;package=owncloud\">Community Debian Repository von Owncloud<\/a> hinzuf\u00fcgen und das neuste Owncloud installieren<\/li>\n<li><span class=\"lang:sh decode:true crayon-inline \">php5-mysql<\/span>\u00a0 dazu installieren<\/li>\n<li>Frage: sollten wir nginx statt apache brauchen? (http:\/\/etapien.com\/guides\/how-to-install-owncloud-on-debian-7-with-nginx\/)<\/li>\n<li><code>192.168.1.158\/owncloud\/<\/code> aufrufen, admin konto erstellen und unbedingt auf |&gt; clicken um mysql als datenbank auszuw\u00e4hlen.<\/li>\n<li>port f\u00fcr SSH auf nicht Standard setzen (22;\u00a0https:\/\/www.adayinthelifeof.nl\/2012\/03\/12\/why-putting-ssh-on-another-port-than-22-is-bad-idea\/)<\/li>\n<li>\n<div>\n<p>Securing MySQL:\u00a0MySQL ships with a few conveniences that are supposed to be removed when put on a real server, to do that type:<br \/>\n<span class=\"lang:sh decode:true crayon-inline \">sudo mysql_secure_installation<\/span><\/p>\n<\/div>\n<\/li>\n<\/ul>\n<h2>DNS<\/h2>\n<ul>\n<li>You need to log into your Domain Registra&#8217;s account and set the A-record for your domain (mysite.com) to point to your router&#8217;s public IP address.<\/li>\n<\/ul>\n<h2>SSL<\/h2>\n<ul>\n<li>https:\/\/blog.hasgeek.com\/2013\/https-everywhere-at-hasgeek\/<\/li>\n<li>https:\/\/hallard.me\/enable-ssl-for-apache-server-in-5-minutes\/<\/li>\n<li>http:\/\/www.startssl.com\/?app=1<\/li>\n<\/ul>\n<h2>VPN<\/h2>\n<ul>\n<li>You&#8217;ll need to forward port 1194 (<a href=\"http:\/\/en.wikipedia.org\/wiki\/User_Datagram_Protocol\" target=\"_blank\">UDP traffic<\/a>) to your Raspberry Pi\u2019s internal IP address.<\/li>\n<li>Install openvpn\n<ul>\n<li>http:\/\/readwrite.com\/2014\/04\/10\/raspberry-pi-vpn-tutorial-server-secure-web-browsing<\/li>\n<li>http:\/\/www.raspberrypihelp.net\/tutorials\/1-openvpn-server-tutorial<\/li>\n<li>http:\/\/www.linuxuser.co.uk\/news\/create-a-vpn-with-the-raspberry-pi<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><strong>WIFI als LAN-Verbindung zu Raspery Pi einrichten<\/strong><\/p>\n<ul>\n<li><span class=\"lang:sh decode:true crayon-inline \">wicd-curses<\/span>\u00a0 installieren (network manager)<\/li>\n<li>die <span class=\"lang:sh decode:true crayon-inline \">netdev<\/span>\u00a0 gruppe f\u00fcr beide users hinzuf\u00fcgen<\/li>\n<li>das wifi sollte automatisch erkannt werden, falls nicht:\n<ul>\n<li><span class=\"lang:sh decode:true crayon-inline \">sudo iwlist eth2 scan<\/span>\u00a0 zeigt alle access points<\/li>\n<li>in der Preferences von wicd wlan0 als device setzen und wicd neu starten<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>How to get the wifi to work:\u00a0http:\/\/sjoerd.luon.net\/posts\/2015\/02\/debian-jessie-on-rpi2\/#comment-2210d3fbce30bfee22ad73d751a14d31$<\/p>\n<h2>Andere programme<\/h2>\n<ul>\n<li><span class=\"lang:sh decode:true crayon-inline\">usbutils<\/span>\u00a0 for\u00a0<span class=\"lang:sh decode:true crayon-inline\">lsusb<\/span><\/li>\n<li>vim<\/li>\n<li><span class=\"lang:sh decode:true crayon-inline\">sudo update-alternatives &#8211;config editor<\/span><\/li>\n<li><span class=\"lang:sh decode:true  crayon-inline \">sudo nmap -sP 192.168.1.0\/24<\/span>\u00a0 to discover the ip addresses around you<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Debian auf SD-Karte laden Debian Jessie image f\u00fcr Pi 2:\u00a0http:\/\/sjoerd.luon.net\/posts\/2015\/02\/debian-jessie-on-rpi2\/ Erh\u00e4lt Raspery Pi mit SD Karte strom, bootet das System von selbst Schritte von Juan: Download and extract the jessie-rpi2-*.img.gz to get an .img file On any debian-based linux type sudo apt-get install bmap-tools\u00a0 and install it. Then type sudo bmaptool copy &#8211;nobmap jessie-rpi2.img \/dev\/sdx\u00a0 &hellip; <a href=\"https:\/\/coolt.ch\/notizen\/debian-auf-raspberry-pi-2\/\" class=\"more-link\"><span class=\"screen-reader-text\">debian auf raspberry pi 2<\/span> weiterlesen<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[14,33,25],"tags":[36,37,42],"_links":{"self":[{"href":"https:\/\/coolt.ch\/notizen\/wp-json\/wp\/v2\/posts\/164"}],"collection":[{"href":"https:\/\/coolt.ch\/notizen\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/coolt.ch\/notizen\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/coolt.ch\/notizen\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/coolt.ch\/notizen\/wp-json\/wp\/v2\/comments?post=164"}],"version-history":[{"count":36,"href":"https:\/\/coolt.ch\/notizen\/wp-json\/wp\/v2\/posts\/164\/revisions"}],"predecessor-version":[{"id":387,"href":"https:\/\/coolt.ch\/notizen\/wp-json\/wp\/v2\/posts\/164\/revisions\/387"}],"wp:attachment":[{"href":"https:\/\/coolt.ch\/notizen\/wp-json\/wp\/v2\/media?parent=164"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/coolt.ch\/notizen\/wp-json\/wp\/v2\/categories?post=164"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/coolt.ch\/notizen\/wp-json\/wp\/v2\/tags?post=164"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}