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.

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