the interface of the KaosCube
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

294 lines
7.9 KiB

1 year ago
  1. # DIY - Setting up the KaosCube
  2. 1. [Hardware](#hardware)
  3. * [Components](#components)
  4. * [Installing the OS](#installing-the-os)
  5. 2. [Software](#software)
  6. * [Upgrade the OS](#upgrade-the-os)
  7. * [Setting up the Access Point](#setting-up-the-access-point)
  8. * [Installing firmware of the wifi dongle](#installing-firmware-of-the-wifi-dongle)
  9. * [Create network connection with new wifi dongle](#create-network-connection-with-new-wifi-dongle)
  10. * [Installing the KaosCube Interface](#installing-the-kaoscube-interface)
  11. 3. [Setting up functions of the KCInterface manually](#setting-up-functions-of-the-kcinterface-manually)
  12. * [Setting up the Hidden Service](#setting-up-the-hidden-service)
  13. # Hardware
  14. ## Components
  15. + Orange Pi Zero
  16. + MiniUsb2Usb Cable for power-supply
  17. + An Ethernet !Crossover! Cable for ssh access
  18. + An MicroSD 16 GB for the Installation of the OS
  19. + MicroSD2Usb Reader to plug in the Laptop
  20. + Linux Wifi Dongle
  21. + Wifi Antenna
  22. + A laptop, preferably with Linux installed
  23. ## Installing the OS
  24. Because Ubuntu is half proprietary, and there is a surveillance door for
  25. Amazon on the system, the KAOS Cube runs on ARMbian - Debian based.
  26. First step is to partition the MicroSD
  27. lsblk # list devices see which /dev/sdX is usb
  28. sudo fdisk /dev/sdb # In my case, the usb is /dev/sdb
  29. Command: d # Inside fdisk: delete all partions
  30. Command: n # Inside fdisk: Create new Partion
  31. # Press enter until you are done
  32. Command: w # Write the changes
  33. sudo mkfs.vfat /dev/sdb1 # format the new partition to fat32
  34. Get a buster image from https://www.armbian.com/download/ for the orange pi
  35. zero, as sshd is still running by default on the resulting machine
  36. Now copy binarywise the image to the partition
  37. sudo dd bs=4M if=ArmbianBusterForOrangePiZero.img of=/dev/sdb
  38. Thats it! The free system should be installed. Put the MicroSD into your OrangePi.
  39. Now connect the cables. The Orange Pi will boot by supplying it with
  40. power.
  41. Connect your computer with ethernet (crossover, special one) cable to the orange pi zero.
  42. The first boot takes a bit longer, up to 2 minutes.
  43. On the Armbian System, SSH on ethernet is enabled. We need to give the
  44. Pi an IP Adress now.
  45. # Install a dhcp client, in my case it was Arch and dhcpd
  46. sudo pacman -S dhcpd
  47. Now we have to create a new local network.
  48. The easiest way is to go into your graphical network-manager. Select the
  49. ethernet connection to your Pi and go on settings.
  50. In my case I went to IPv4 settings. Then I selected "Shared to other
  51. computers" Method. After this add a new Address:
  52. Address 10.0.0.1 # The 10.0.0.1 Number is normally used for local
  53. # networks.
  54. Netmask 24 # You can also put in 255.255.255.0, which only
  55. # says to the dhcp to give a certain range of
  56. # adresses starting at 10.0.0.0
  57. Gateway 10.0.0.1 # The Gateway is the adress of your laptop
  58. # itself
  59. Now you can run the command
  60. sudo arp -a
  61. in your bash, after restarting the connection over ethernet to your Pi.
  62. On your Orange Pi, the small green Light close to the mini usb port
  63. should be lighting. If the connection is established, you should see it
  64. blinking. If one or both are not the case, try to reinstall the ARMbian
  65. image, or zero the first part of the partition, maybe it was not booting
  66. You will see an assigned IP Adress on your ethernet interface, on arch
  67. for me it was the standard one enp0s25
  68. The IP was 10.0.0.254, so I could connect through ssh with my Orange
  69. Pi now, and start to set up the system.
  70. ssh root@10.0.0.254
  71. If everything worked, type in 1234 as the password and follow the instructions.
  72. If not, check out
  73. https://docs.armbian.com/User-Guide_Getting-Started/#how-to-prepare-a-sd-card
  74. For example, you can learn there how to verify the hash of your download, to be sure nobody
  75. gave you a virus instead of an OS :)
  76. # Software
  77. ## Upgrade the OS
  78. In the newer versions of armbian, ssh is deactivated by default.
  79. To save time, we installed an armbian buster.
  80. Generally, it is important to keep your KaosCube up to date.
  81. That is why, after getting access to the Cube, the first thing is
  82. an upgrade to bullseye (which is debian stable at the time of this
  83. writing and has the latest debian-security updates inside)
  84. sudo apt update
  85. sudo apt dist-upgrade -y
  86. Then change the apt configuration file
  87. sudo nano /etc/apt/sources.list
  88. and change all words which are "buster" to "bullseye".
  89. Except of the line regarding debian-security. There, you have
  90. to change "buster" to "bullseye-security".
  91. Save (in nano that is strg+o) and exit nano (strg+x)
  92. Then update with the new list and run the upgrade
  93. sudo apt update
  94. sudo apt upgrade
  95. During the upgrade, always choose ok or default :).
  96. Then go to /etc/apt/sources.list.d/armbian.list and change to bullseye there too
  97. Then run again the update and upgrade.
  98. ## Setting up the Access Point
  99. nmcli con add type wifi ifname wlan0 mode ap con-name kaoscube ssid KaosCube ipv4.method shared
  100. nmcli con modify kaoscube wifi-sec.key-mgmt wpa-psk
  101. nmcli con modify kaoscube wifi-sec.psk "ThePasswordYouLike"
  102. nmcli con up kaoscube
  103. ## Installing firmware of the wifi dongle
  104. First thing to do is updating the apt ressources
  105. sudo apt update
  106. Then install git
  107. sudo apt install git
  108. Install dkms
  109. sudo apt install dkms
  110. Install the newest headers
  111. sudo apt-get install linux-headers-current-sunxi build-essential
  112. When installing build-essential, you will be prompted whether to restart
  113. or not. Enter no automatic restart and then for cron and ssh enter ok.
  114. For the ssh config, I kept the old one.
  115. after the install, restart the system with
  116. sudo reboot
  117. Now download the firmware
  118. git clone https://github.com/kelebek333/rtl8188fu
  119. Now go to the folder rtl8188fu. Add, build and install it with dkms
  120. sudo dkms add ./rtl8188fu
  121. sudo dkms build rtl8188fu/1.0
  122. sudo dkms install rtl8188fu/1.0
  123. sudo cp ./rtl8188fu/firmware/rtl8188fufw.bin /lib/firmware/rtlwifi/
  124. After all commands have run successfully, restart the system
  125. sudo reboot
  126. ##Create network connection with new wifi dongle
  127. First look up with ifconfig for the interfaces, and which one is the one of the dongle
  128. sudo ifconfig
  129. there should be one called wlan0 or wlan1, which is the small one already on the orange pi zero.
  130. In addition, there should be one with the name wlx00... something.
  131. This one you should use with the following command:
  132. nmcli device wifi connect 'FRITZ!Box 6430 Cable TL' password "98475637998946115486" ifname wlan0
  133. ##Installing the KaosCube Interface
  134. First add a new user, if you are still root:
  135. adduser kaosuser
  136. Then add the user to sudoers:
  137. usermod -aG sudo kaosuser
  138. Now change to user (still being root) and go to home directory
  139. su kaosuser
  140. cd
  141. First clone the interface from git:
  142. git clone https://code.basabuuka.org/alpcentaur/kc-interface.git
  143. After that, install php (working version is 7.4, but newer ones should
  144. also work)
  145. sudo apt install php
  146. Also the interface needs the following libraries:
  147. sudo apt install tor
  148. Now go in the directory kc-interface and run
  149. bash startserver.sh
  150. You will have the interface running on localhost:666
  151. To get the interface, connect to the ap kaoscube and enter the
  152. IP of its wifi interface with a double point and then 666.
  153. # Setting up functions of the KCInterface manually
  154. ## Setting up the Hidden Service
  155. First install Tor:
  156. sudo apt-get install tor
  157. Edit the torrc file:
  158. sudo nano /etc/tor/torrc
  159. Look for the line ############### This section is just for location-hidden services ###
  160. under this line, enable (uncomment) HiddenServiceDir and HiddenServicePort
  161. in our case,
  162. HiddenServiceDir /var/lib/tor/hidden_service/
  163. HiddenServicePort 80 127.0.0.1:80
  164. HiddenServicePort 22 127.0.0.1:22
  165. After restarting tor with
  166. sudo systemctl restart tor
  167. your hidden service is running, and you can get its address under
  168. /var/lib/tor/hidden_service/ , or whatever name or path you wrote in
  169. the torrc.