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.

349 lines
11 KiB

1 year ago
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. 4. [Features](#features)
  14. * [Installing 12d1:1f01 Huawei E353/E3131 LTE Usb Modem](#installing-12d1\:1f01-huawei-e353\/e3131-lte-usb-modem)
  15. # Hardware
  16. ## Components
  17. + Orange Pi Zero
  18. + MiniUsb2Usb Cable for power-supply
  19. + An Ethernet !Crossover! Cable for ssh access
  20. + An MicroSD 30 GB for the Installation of the OS
  21. + MicroSD2Usb Reader to plug in the Laptop
  22. + Linux Wifi Dongle
  23. + Wifi Antenna
  24. + A laptop, preferably with Linux installed
  25. ## Installing the OS
  26. Because Ubuntu is half proprietary, and there is a surveillance door for
  27. Amazon on the system, the KAOS Cube runs on ARMbian - Debian based.
  28. You could get a debian buster image from https://www.armbian.com/download/ for the orange pi
  29. zero, as sshd is still running by default on the resulting machine, for connecting. But all that images, if bullseye or buster, wont have a working ap enabling on board antenna driver.
  30. The image provided has it.
  31. And it gives an Access Point already configured.
  32. On the newest Bullseye Security, one of the securest in the internet.
  33. Git clone the repository to get the image if you like, or go on with bullseye instead in the same manner as described.
  34. And, more importantly, as of my writing, the xradio does not work with Bullseye and Bookworm. But that is writing of a year ago.
  35. First untar and extract from downloaded archive from my git server.
  36. with
  37. tar -xzvf kaosimage.tar.gz
  38. Now comes partitioning.
  39. Be careful.
  40. Look up the partitions, with
  41. lsblk
  42. Have a look that the microsd of minimum 30GB is not mounted, and
  43. start copying to the root of the microsd.
  44. Now copy binarywise the image to the partition
  45. sudo dd bs=4M if=kaosimage.img of=/dev/mmlp
  46. Thats it! The free system should be installed. Put the MicroSD into your OrangePi.
  47. Now connect the cables. The Orange Pi will boot by supplying it with
  48. power.
  49. Here comes the part, how to connect over ethernet to other computers.
  50. The image provided just gives you a wpa2 encrypted interface, so not secure for first
  51. setup of keys on your client, and on your new own autonomous server.
  52. If you are sure to be in a cage of aluminium, you can also make your first connection. Your first relaxed connection over an Access Point - the Kaoscube.image will generate when put on power.
  53. For Connect your computer with ethernet (crossover, special one) cable to the orange pi zero.
  54. The first boot takes a bit longer, up to 2 minutes.
  55. Make sure, that not only the lights of the ethernet port on the orange pi zero have the lights on.
  56. But there is another small green light on the side of the micro usb power plug. This one has to be on.
  57. Sometimes, especially with the buster image, the startup does not work properly, and you will not see a
  58. connection on your Laptop, because the os did not start at all. Just replug the power if that is the case
  59. (no light on).
  60. On the Armbian System, SSH on ethernet is enabled. We need to give the
  61. Pi an IP Adress now.
  62. # Install a dhcp server, in my case it was Arch and dhcpd
  63. sudo pacman -S dhcpd
  64. Now we have to create a new local network.
  65. The easiest way is to go into your graphical network-manager. Select the
  66. ethernet connection to your Pi and go on settings.
  67. In my case I went to IPv4 settings. Then I selected "Shared to other
  68. computers" Method. After this add a new Address:
  69. Address 10.0.0.1 # The 10.0.0.1 Number is normally used for local
  70. # networks.
  71. Netmask 24 # You can also put in 255.255.255.0, which only
  72. # says to the dhcp to give a certain range of
  73. # adresses starting at 10.0.0.0
  74. Gateway 10.0.0.1 # The Gateway is the adress of your laptop
  75. # itself
  76. Now you can run the command
  77. sudo arp -a
  78. in your bash, after restarting the connection over ethernet to your Pi.
  79. On your Orange Pi, the small green Light close to the mini usb port
  80. should be lighting. If the connection is established, you should see it
  81. blinking. If one or both are not the case, try to reinstall the ARMbian
  82. image, or zero the first part of the partition, maybe it was not booting
  83. You will see an assigned IP Adress on your ethernet interface, on arch
  84. for me it was the standard one enp0s25
  85. The IP was 10.0.0.254, so I could connect through ssh with my Orange
  86. Pi now, and start to set up the system.
  87. ssh root@10.0.0.254
  88. If everything worked, type in 1234 as the password and follow the instructions.
  89. If not, check out
  90. https://docs.armbian.com/User-Guide_Getting-Started/#how-to-prepare-a-sd-card
  91. For example, you can learn there how to verify the hash of your download, to be sure nobody
  92. gave you a virus instead of an OS :)
  93. # Software
  94. ## Upgrade the OS
  95. In the newer versions of armbian, ssh is deactivated by default.
  96. To save time, we could have installed an armbian buster.
  97. Generally, it is important to keep your KaosCube up to date.
  98. That is why, after getting access to the Cube, the first thing would have been
  99. an upgrade to bullseye (which is debian stable at the time of this
  100. writing and has the latest debian-security updates inside)
  101. With the kaosimage you dont have to do a system upgrade, but the updates are always important. To give you a Trick for updating servers, try to use only
  102. sudo apt update
  103. sudo apt upgrade
  104. During the upgrade, always choose ok or default :).
  105. When something appears broken, which will be the case if you have a lot of servers,
  106. it will be one of the updates.
  107. That is why, we first check that.
  108. In case there is a break, we can have a rollback to before the update.
  109. Based on the cache of the package manager.
  110. If everything went well on the other side, which will be the case if updates are made fast and rolled back directly if broken, then you can just go on to cleaning and auto cleaning the system and you are fresh to go.
  111. ## Setting up the Access Point (if you want to, because in the end the provided image has one configured, and one can copy paste that too. but one can extend too.)
  112. On buster, the access point can be set up persistently with the commands:
  113. nmcli con add type wifi ifname wlan0 mode ap con-name kaoscube ssid KaosCube ipv4.method shared
  114. nmcli con modify kaoscube wifi-sec.key-mgmt wpa-psk
  115. nmcli con modify kaoscube wifi-sec.psk "ThePasswordYouLike"
  116. nmcli con up kaoscube
  117. ## Installing firmware of the wifi dongle
  118. First thing to do is updating the apt ressources
  119. sudo apt update
  120. Then install git
  121. sudo apt install git
  122. Install dkms
  123. sudo apt install dkms
  124. Install the newest headers
  125. sudo apt-get install linux-headers-current-sunxi build-essential
  126. When installing build-essential, you will be prompted whether to restart
  127. or not. Enter no automatic restart and then for cron and ssh enter ok.
  128. For the ssh config, I kept the old one.
  129. after the install, restart the system with
  130. sudo reboot
  131. Now download the firmware
  132. git clone https://github.com/kelebek333/rtl8188fu
  133. Now go to the folder rtl8188fu. Add, build and install it with dkms
  134. sudo dkms add ./rtl8188fu
  135. sudo dkms build rtl8188fu/1.0
  136. sudo dkms install rtl8188fu/1.0
  137. sudo cp ./rtl8188fu/firmware/rtl8188fufw.bin /lib/firmware/rtlwifi/
  138. After all commands have run successfully, restart the system
  139. sudo reboot
  140. ## Create network connection with new wifi dongle (not sure if thats already or still on the image)
  141. First look up with ifconfig for the interfaces, and which one is the one of the dongle
  142. sudo ifconfig
  143. there should be one called wlan0 or wlan1, which is the small one already on the orange pi zero.
  144. In addition, there should be one with the name wlx00... something.
  145. This one you should use with the following command:
  146. nmcli device wifi connect 'FRITZ!Box 6430 Cable TL' password "98475637998946115486" ifname wlan0
  147. ## Installing the KaosCube Interface
  148. First add a new user, if you are still root:
  149. adduser kaosuser
  150. Then add the user to sudoers:
  151. usermod -aG sudo kaosuser
  152. Now change to user (still being root) and go to home directory
  153. su kaosuser
  154. cd
  155. Remember cloning the interface from git?
  156. git clone https://code.basabuuka.org/alpcentaur/kc-interface.git
  157. After that, install php (working version is 7.4, but newer ones should
  158. also work)
  159. sudo apt install php
  160. Also the interface needs the following libraries:
  161. sudo apt install tor
  162. Now go in the directory kc-interface and run
  163. bash startserver.sh
  164. You will have the interface running on localhost:666
  165. To get the interface, connect to the ap kaoscube and enter the
  166. IP of its wifi interface with a double point and then 666.
  167. # Setting up functions of the KCInterface manually
  168. ## Setting up the Hidden Service
  169. First install Tor:
  170. sudo apt-get install tor
  171. Edit the torrc file:
  172. sudo nano /etc/tor/torrc
  173. Look for the line ############### This section is just for location-hidden services ###
  174. under this line, enable (uncomment) HiddenServiceDir and HiddenServicePort
  175. in our case,
  176. HiddenServiceDir /var/lib/tor/hidden_service/
  177. HiddenServicePort 80 127.0.0.1:80
  178. HiddenServicePort 22 127.0.0.1:22
  179. After restarting tor with
  180. sudo systemctl restart tor
  181. your hidden service is running, and you can get its address under
  182. /var/lib/tor/hidden_service/ , or whatever name or path you wrote in
  183. the torrc.
  184. # Features
  185. ## Installing 12d1:1f01 Huawei E353/E3131 LTE Usb Modem
  186. First issue
  187. lsusb
  188. to check, if you are trying to install the right LTE usb dongle.
  189. Being connected to the internet with your laptop, and having the shared
  190. internet connection being issued from your laptop, the kaoscube has
  191. internet too.
  192. Then, install usb_modeswitch with the command
  193. sudo apt install usb-modeswitch usb-modeswitch-data
  194. and then switch to modem mode for the usb stick
  195. sudo usb_modeswitch -v 12d1 -p 1f01 -M '55534243123456780000000000000a11062000000000000100000000000000'
  196. After that, lsusb will show you that the usb modem is now recognized as
  197. a modem.
  198. Now you can issue
  199. ip a
  200. and look for the new generated interface of the modem.
  201. take it's IP address, in my case it was 192.168.8.100/24, and replace
  202. the last bit with a 1 (192.168.8.1).
  203. Put that IP address into the browser of your laptop.