Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save beosro/aebf6c82abb923e7609b3394e37e469d to your computer and use it in GitHub Desktop.

Select an option

Save beosro/aebf6c82abb923e7609b3394e37e469d to your computer and use it in GitHub Desktop.

Revisions

  1. @ruyadorno ruyadorno revised this gist Aug 5, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion install-arch-linux-on-a-raspberrypi.md
    Original file line number Diff line number Diff line change
    @@ -21,7 +21,7 @@
    - Setup connection with **netctl**
    - Disconnect interface from **iw** `ip link set wlan0 down`
    - Setup netctl file from example: `cp /etc/netctl/examples/wireless-wpa-static /etc/netctl/`
    - Get a 256-bit pre-shared key to save instead of plain text password: `wpa_passphrase your_essid passphrase`
    - Get a [256-bit pre-shared key](https://wiki.archlinux.org/index.php/Netctl#Wireless_.28WPA-PSK.29) to save instead of plain text password: `wpa_passphrase your_essid passphrase`
    - Start wlan: `netctl start wireless-wpa-static`
    - Make it start on boot: `netctl enable wireless-wpa-static`
    - More info on **netctl**: https://wiki.archlinux.org/index.php/Netctl#Installation
  2. @ruyadorno ruyadorno revised this gist Aug 5, 2016. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions install-arch-linux-on-a-raspberrypi.md
    Original file line number Diff line number Diff line change
    @@ -53,6 +53,7 @@
    - Open SSH port: `iptables -A TCP -p tcp --dport 22 -j ACCEPT`
    - Start **iptables**: `systemctl start iptables`
    - Enable it: `systemctl enable iptables`
    - Complete guide is here: https://wiki.archlinux.org/index.php/Simple_stateful_firewall
    0. Install **sudo**
    - `pacman -S sudo`

  3. @ruyadorno ruyadorno revised this gist Aug 5, 2016. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion install-arch-linux-on-a-raspberrypi.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    0. (optinal) OSX + Virtualbox users need an extra step to format sd card: http://www.geekytidbits.com/mount-sd-card-virtualbox-from-mac-osx/
    0. (optional) OSX + Virtualbox users need an extra step to format sd card: http://www.geekytidbits.com/mount-sd-card-virtualbox-from-mac-osx/
    0. Head to https://archlinuxarm.org/platforms/armv6/raspberry-pi (Raspberrypi Zero) for instructions on how to get ARMv6 dist of Arch Linux
    0. Plug SD card on Raspbery Pi and boot it up, it should be ready to go
    0. Login to Arch Linux root:
    @@ -53,6 +53,8 @@
    - Open SSH port: `iptables -A TCP -p tcp --dport 22 -j ACCEPT`
    - Start **iptables**: `systemctl start iptables`
    - Enable it: `systemctl enable iptables`
    0. Install **sudo**
    - `pacman -S sudo`

    _Save this for future reference_

  4. @ruyadorno ruyadorno revised this gist Aug 5, 2016. 1 changed file with 28 additions and 28 deletions.
    56 changes: 28 additions & 28 deletions install-arch-linux-on-a-raspberrypi.md
    Original file line number Diff line number Diff line change
    @@ -13,46 +13,46 @@
    - `passwd root`
    0. Now may be a good point to configure internet
    - Wireless
    0. Test if wireless is working: `iw dev` see if it outputs `wlan0` info
    1. May need to activate interface with `ip link set wlan0 up`
    2. Test interface with `ip link show wlan0`
    3. Find your wifi `iw dev wlan0 scan | less`
    4. More info on: https://wiki.archlinux.org/index.php/Wireless_network_configuration
    5. Setup connection with **netctl**
    6. Disconnect interface from **iw** `ip link set wlan0 down`
    7. Setup netctl file from example: `cp /etc/netctl/examples/wireless-wpa-static /etc/netctl/`
    8. Get a 256-bit pre-shared key to save instead of plain text password: `wpa_passphrase your_essid passphrase`
    9. Start wlan: `netctl start wireless-wpa-static`
    10. Make it start on boot: `netctl enable wireless-wpa-static`
    10. More info on **netctl**: https://wiki.archlinux.org/index.php/Netctl#Installation
    - Test if wireless is working: `iw dev` see if it outputs `wlan0` info
    - May need to activate interface with `ip link set wlan0 up`
    - Test interface with `ip link show wlan0`
    - Find your wifi `iw dev wlan0 scan | less`
    - More info on: https://wiki.archlinux.org/index.php/Wireless_network_configuration
    - Setup connection with **netctl**
    - Disconnect interface from **iw** `ip link set wlan0 down`
    - Setup netctl file from example: `cp /etc/netctl/examples/wireless-wpa-static /etc/netctl/`
    - Get a 256-bit pre-shared key to save instead of plain text password: `wpa_passphrase your_essid passphrase`
    - Start wlan: `netctl start wireless-wpa-static`
    - Make it start on boot: `netctl enable wireless-wpa-static`
    - More info on **netctl**: https://wiki.archlinux.org/index.php/Netctl#Installation
    0. Replace default ssh port
    0. `vi /etc/ssh/sshd_config`
    1. Locate `#Port 22` line and replace with whatever port
    - `vi /etc/ssh/sshd_config`
    - Locate `#Port 22` line and replace with whatever port
    0. Setup a stateful firewall
    0. Start fresh: `iptables-restore < /etc/iptables/empty.rules`
    1. Create chains:
    - Start fresh: `iptables-restore < /etc/iptables/empty.rules`
    - Create chains:
    ```sh
    iptables -N TCP
    iptables -N UDP
    ```
    2. Drop any FORWARD: `iptables -P FORWARD DROP`
    3. `iptables -P OUTPUT ACCEPT`
    4. Drop INPUT by default: `iptables -P INPUT DROP`
    5. Allow established connections: `iptables -A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT`
    6. `iptables -A INPUT -i lo -j ACCEPT`
    7. `iptables -A INPUT -m conntrack --ctstate INVALID -j DROP`
    8. `iptables -A INPUT -p icmp --icmp-type 8 -m conntrack --ctstate NEW -j ACCEPT`
    9. Handle TCP/UDP
    - Drop any FORWARD: `iptables -P FORWARD DROP`
    - `iptables -P OUTPUT ACCEPT`
    - Drop INPUT by default: `iptables -P INPUT DROP`
    - Allow established connections: `iptables -A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT`
    - `iptables -A INPUT -i lo -j ACCEPT`
    - `iptables -A INPUT -m conntrack --ctstate INVALID -j DROP`
    - `iptables -A INPUT -p icmp --icmp-type 8 -m conntrack --ctstate NEW -j ACCEPT`
    - Handle TCP/UDP
    ```sh
    iptables -A INPUT -p udp -m conntrack --ctstate NEW -j UDP
    iptables -A INPUT -p tcp --syn -m conntrack --ctstate NEW -j TCP
    iptables -A INPUT -p udp -j REJECT --reject-with icmp-port-unreachable
    iptables -A INPUT -p tcp -j REJECT --reject-with tcp-reset
    ```
    10. Reject other protocols: `iptables -A INPUT -j REJECT --reject-with icmp-proto-unreachable`
    11. Open SSH port: `iptables -A TCP -p tcp --dport 22 -j ACCEPT`
    12. Start **iptables**: `systemctl start iptables`
    13. Enable it for reboot: `systemctl enable iptables`
    - Reject other protocols: `iptables -A INPUT -j REJECT --reject-with icmp-proto-unreachable`
    - Open SSH port: `iptables -A TCP -p tcp --dport 22 -j ACCEPT`
    - Start **iptables**: `systemctl start iptables`
    - Enable it: `systemctl enable iptables`

    _Save this for future reference_

  5. @ruyadorno ruyadorno revised this gist Aug 5, 2016. 1 changed file with 25 additions and 0 deletions.
    25 changes: 25 additions & 0 deletions install-arch-linux-on-a-raspberrypi.md
    Original file line number Diff line number Diff line change
    @@ -28,6 +28,31 @@
    0. Replace default ssh port
    0. `vi /etc/ssh/sshd_config`
    1. Locate `#Port 22` line and replace with whatever port
    0. Setup a stateful firewall
    0. Start fresh: `iptables-restore < /etc/iptables/empty.rules`
    1. Create chains:
    ```sh
    iptables -N TCP
    iptables -N UDP
    ```
    2. Drop any FORWARD: `iptables -P FORWARD DROP`
    3. `iptables -P OUTPUT ACCEPT`
    4. Drop INPUT by default: `iptables -P INPUT DROP`
    5. Allow established connections: `iptables -A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT`
    6. `iptables -A INPUT -i lo -j ACCEPT`
    7. `iptables -A INPUT -m conntrack --ctstate INVALID -j DROP`
    8. `iptables -A INPUT -p icmp --icmp-type 8 -m conntrack --ctstate NEW -j ACCEPT`
    9. Handle TCP/UDP
    ```sh
    iptables -A INPUT -p udp -m conntrack --ctstate NEW -j UDP
    iptables -A INPUT -p tcp --syn -m conntrack --ctstate NEW -j TCP
    iptables -A INPUT -p udp -j REJECT --reject-with icmp-port-unreachable
    iptables -A INPUT -p tcp -j REJECT --reject-with tcp-reset
    ```
    10. Reject other protocols: `iptables -A INPUT -j REJECT --reject-with icmp-proto-unreachable`
    11. Open SSH port: `iptables -A TCP -p tcp --dport 22 -j ACCEPT`
    12. Start **iptables**: `systemctl start iptables`
    13. Enable it for reboot: `systemctl enable iptables`

    _Save this for future reference_

  6. @ruyadorno ruyadorno revised this gist Aug 5, 2016. No changes.
  7. @ruyadorno ruyadorno revised this gist Aug 5, 2016. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions install-arch-linux-on-a-raspberrypi.md
    Original file line number Diff line number Diff line change
    @@ -25,6 +25,9 @@
    9. Start wlan: `netctl start wireless-wpa-static`
    10. Make it start on boot: `netctl enable wireless-wpa-static`
    10. More info on **netctl**: https://wiki.archlinux.org/index.php/Netctl#Installation
    0. Replace default ssh port
    0. `vi /etc/ssh/sshd_config`
    1. Locate `#Port 22` line and replace with whatever port

    _Save this for future reference_

  8. @ruyadorno ruyadorno revised this gist Aug 5, 2016. 1 changed file with 3 additions and 2 deletions.
    5 changes: 3 additions & 2 deletions install-arch-linux-on-a-raspberrypi.md
    Original file line number Diff line number Diff line change
    @@ -20,9 +20,10 @@
    4. More info on: https://wiki.archlinux.org/index.php/Wireless_network_configuration
    5. Setup connection with **netctl**
    6. Disconnect interface from **iw** `ip link set wlan0 down`
    7. Setup netctl file from example: `cp /etc/netctl/examples/wireless-wpa /etc/netctl/`
    7. Setup netctl file from example: `cp /etc/netctl/examples/wireless-wpa-static /etc/netctl/`
    8. Get a 256-bit pre-shared key to save instead of plain text password: `wpa_passphrase your_essid passphrase`
    9. Start wlan: `netctl start wireless-wpa`
    9. Start wlan: `netctl start wireless-wpa-static`
    10. Make it start on boot: `netctl enable wireless-wpa-static`
    10. More info on **netctl**: https://wiki.archlinux.org/index.php/Netctl#Installation

    _Save this for future reference_
  9. @ruyadorno ruyadorno revised this gist Aug 4, 2016. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions install-arch-linux-on-a-raspberrypi.md
    Original file line number Diff line number Diff line change
    @@ -18,12 +18,12 @@
    2. Test interface with `ip link show wlan0`
    3. Find your wifi `iw dev wlan0 scan | less`
    4. More info on: https://wiki.archlinux.org/index.php/Wireless_network_configuration
    5. Setup connection with netctl
    5. Setup connection with **netctl**
    6. Disconnect interface from **iw** `ip link set wlan0 down`
    7. Setup netctl file from example: `cp /etc/netctl/examples/wireless-wpa /etc/netctl/`
    8. Get a 256-bit pre-shared key to save instead of plain text password: `wpa_passphrase your_essid passphrase`
    9. Start wlan: `netctl start wireless-wpa`
    10. More info on netctl: https://wiki.archlinux.org/index.php/Netctl#Installation
    10. More info on **netctl**: https://wiki.archlinux.org/index.php/Netctl#Installation

    _Save this for future reference_

  10. @ruyadorno ruyadorno revised this gist Aug 4, 2016. 1 changed file with 13 additions and 0 deletions.
    13 changes: 13 additions & 0 deletions install-arch-linux-on-a-raspberrypi.md
    Original file line number Diff line number Diff line change
    @@ -11,6 +11,19 @@
    - `userdel alarm`
    0. Define new password for `root`
    - `passwd root`
    0. Now may be a good point to configure internet
    - Wireless
    0. Test if wireless is working: `iw dev` see if it outputs `wlan0` info
    1. May need to activate interface with `ip link set wlan0 up`
    2. Test interface with `ip link show wlan0`
    3. Find your wifi `iw dev wlan0 scan | less`
    4. More info on: https://wiki.archlinux.org/index.php/Wireless_network_configuration
    5. Setup connection with netctl
    6. Disconnect interface from **iw** `ip link set wlan0 down`
    7. Setup netctl file from example: `cp /etc/netctl/examples/wireless-wpa /etc/netctl/`
    8. Get a 256-bit pre-shared key to save instead of plain text password: `wpa_passphrase your_essid passphrase`
    9. Start wlan: `netctl start wireless-wpa`
    10. More info on netctl: https://wiki.archlinux.org/index.php/Netctl#Installation

    _Save this for future reference_

  11. @ruyadorno ruyadorno revised this gist Jul 25, 2016. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion install-arch-linux-on-a-raspberrypi.md
    Original file line number Diff line number Diff line change
    @@ -18,4 +18,6 @@ More info on user namanagement: https://wiki.archlinux.org/index.php/users_and_g

    General setup recommendations: https://wiki.archlinux.org/index.php/general_recommendations

    General system maintenance: https://wiki.archlinux.org/index.php/System_maintenance
    General system maintenance: https://wiki.archlinux.org/index.php/System_maintenance

    Raspberry Pi Zero Headless Setup: https://davidmaitland.me/2015/12/raspberry-pi-zero-headless-setup/
  12. @ruyadorno ruyadorno revised this gist Jul 25, 2016. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion install-arch-linux-on-a-raspberrypi.md
    Original file line number Diff line number Diff line change
    @@ -16,4 +16,6 @@ _Save this for future reference_

    More info on user namanagement: https://wiki.archlinux.org/index.php/users_and_groups#User_management

    General setup recommendations: https://wiki.archlinux.org/index.php/general_recommendations
    General setup recommendations: https://wiki.archlinux.org/index.php/general_recommendations

    General system maintenance: https://wiki.archlinux.org/index.php/System_maintenance
  13. @ruyadorno ruyadorno revised this gist Jul 25, 2016. 1 changed file with 5 additions and 10 deletions.
    15 changes: 5 additions & 10 deletions install-arch-linux-on-a-raspberrypi.md
    Original file line number Diff line number Diff line change
    @@ -5,18 +5,13 @@
    - user: root
    - pass: root
    0. Create new user:
    ```sh
    useradd -m -G wheel -s /bin/bash username
    passwd username
    ```
    - `useradd -m -G wheel -s /bin/bash username`
    - `passwd username`
    0. Remove defaul `alarm` user:
    ```sh
    userdel alarm
    ```
    - `userdel alarm`
    0. Define new password for `root`
    ```sh
    passwd root
    ```
    - `passwd root`

    _Save this for future reference_

    More info on user namanagement: https://wiki.archlinux.org/index.php/users_and_groups#User_management
  14. @ruyadorno ruyadorno revised this gist Jul 25, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion install-arch-linux-on-a-raspberrypi.md
    Original file line number Diff line number Diff line change
    @@ -21,4 +21,4 @@ _Save this for future reference_

    More info on user namanagement: https://wiki.archlinux.org/index.php/users_and_groups#User_management

    0. General setup recommendations: https://wiki.archlinux.org/index.php/general_recommendations
    General setup recommendations: https://wiki.archlinux.org/index.php/general_recommendations
  15. @ruyadorno ruyadorno revised this gist Jul 25, 2016. 1 changed file with 4 additions and 5 deletions.
    9 changes: 4 additions & 5 deletions install-arch-linux-on-a-raspberrypi.md
    Original file line number Diff line number Diff line change
    @@ -5,11 +5,10 @@
    - user: root
    - pass: root
    0. Create new user:
    ```sh
    useradd -m -G wheel -s /bin/bash username
    passwd username
    ```

    ```sh
    useradd -m -G wheel -s /bin/bash username
    passwd username
    ```
    0. Remove defaul `alarm` user:
    ```sh
    userdel alarm
  16. @ruyadorno ruyadorno revised this gist Jul 25, 2016. 1 changed file with 10 additions and 10 deletions.
    20 changes: 10 additions & 10 deletions install-arch-linux-on-a-raspberrypi.md
    Original file line number Diff line number Diff line change
    @@ -5,19 +5,19 @@
    - user: root
    - pass: root
    0. Create new user:
    ```sh
    useradd -m -G wheel -s /bin/bash username
    passwd username
    ```

    0. Remove defaul `alarm` user:
    ```sh
    userdel alarm
    useradd -m -G wheel -s /bin/bash username
    passwd username
    ```

    0. Remove defaul `alarm` user:
    ```sh
    userdel alarm
    ```
    0. Define new password for `root`
    ```sh
    passwd root
    ```
    ```sh
    passwd root
    ```
    _Save this for future reference_

    More info on user namanagement: https://wiki.archlinux.org/index.php/users_and_groups#User_management
  17. @ruyadorno ruyadorno revised this gist Jul 25, 2016. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions install-arch-linux-on-a-raspberrypi.md
    Original file line number Diff line number Diff line change
    @@ -5,10 +5,10 @@
    - user: root
    - pass: root
    0. Create new user:
    ```sh
    useradd -m -G wheel -s /bin/bash username
    passwd username
    ```
    ```sh
    useradd -m -G wheel -s /bin/bash username
    passwd username
    ```

    0. Remove defaul `alarm` user:
    ```sh
  18. @ruyadorno ruyadorno revised this gist Jul 25, 2016. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions install-arch-linux-on-a-raspberrypi.md
    Original file line number Diff line number Diff line change
    @@ -10,9 +10,6 @@ useradd -m -G wheel -s /bin/bash username
    passwd username
    ```

    More info on user namanagement: https://wiki.archlinux.org/index.php/users_and_groups#User_management


    0. Remove defaul `alarm` user:
    ```sh
    userdel alarm
    @@ -21,5 +18,8 @@ userdel alarm
    ```sh
    passwd root
    ```
    _Save this down!_
    _Save this for future reference_

    More info on user namanagement: https://wiki.archlinux.org/index.php/users_and_groups#User_management

    0. General setup recommendations: https://wiki.archlinux.org/index.php/general_recommendations
  19. @ruyadorno ruyadorno revised this gist Jul 25, 2016. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions install-arch-linux-on-a-raspberrypi.md
    Original file line number Diff line number Diff line change
    @@ -9,6 +9,10 @@
    useradd -m -G wheel -s /bin/bash username
    passwd username
    ```

    More info on user namanagement: https://wiki.archlinux.org/index.php/users_and_groups#User_management


    0. Remove defaul `alarm` user:
    ```sh
    userdel alarm
  20. @ruyadorno ruyadorno renamed this gist Jul 25, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md → install-arch-linux-on-a-raspberrypi.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    0. (optinal) OSX + Virtualbox users need an extra step to format sd card: http://www.geekytidbits.com/mount-sd-card-virtualbox-from-mac-osx/
    0. Head to https://archlinuxarm.org/platforms/armv6/raspberry-pi for instructions on how to get ARMv6 dist of Arch Linux
    0. Head to https://archlinuxarm.org/platforms/armv6/raspberry-pi (Raspberrypi Zero) for instructions on how to get ARMv6 dist of Arch Linux
    0. Plug SD card on Raspbery Pi and boot it up, it should be ready to go
    0. Login to Arch Linux root:
    - user: root
  21. @ruyadorno ruyadorno created this gist Jul 23, 2016.
    21 changes: 21 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@
    0. (optinal) OSX + Virtualbox users need an extra step to format sd card: http://www.geekytidbits.com/mount-sd-card-virtualbox-from-mac-osx/
    0. Head to https://archlinuxarm.org/platforms/armv6/raspberry-pi for instructions on how to get ARMv6 dist of Arch Linux
    0. Plug SD card on Raspbery Pi and boot it up, it should be ready to go
    0. Login to Arch Linux root:
    - user: root
    - pass: root
    0. Create new user:
    ```sh
    useradd -m -G wheel -s /bin/bash username
    passwd username
    ```
    0. Remove defaul `alarm` user:
    ```sh
    userdel alarm
    ```
    0. Define new password for `root`
    ```sh
    passwd root
    ```
    _Save this down!_