vm:unifi
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| vm:unifi [2022/06/20 18:25] – [Timezone] warnaud | vm:unifi [2023/02/16 09:43] (current) – [Docker] warnaud | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Unifi ====== | ||
| + | VM to install [[https:// | ||
| + | ====== Docker ====== | ||
| + | Since everything else failed...\\ | ||
| + | References: | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | Download Ubuntu 18.04 container Template from Proxmox: Proxmox > Local > Templates\\ | ||
| + | Set up a CT with this Template with password/ | ||
| + | Download script: | ||
| + | <code bash> | ||
| + | wget https:// | ||
| + | bash unifi-7.3.83.sh | ||
| + | </ | ||
| + | |||
| + | |||
| + | ====== Ubuntu ====== | ||
| + | |||
| + | OS: Ubuntu 22.04 Server LTS (laziness, mostly)\\ | ||
| + | IP: 192.168.1.70 (unifi.fortier-family.com) | ||
| + | |||
| + | ===== Install ===== | ||
| + | Following : | ||
| + | * https:// | ||
| + | |||
| + | <code bash> | ||
| + | apt update && apt upgrade -y | ||
| + | apt install openjdk-8-jdk ca-certificates apt-transport-https -y | ||
| + | |||
| + | echo 'deb https:// | ||
| + | apt-key adv --keyserver keyserver.ubuntu.com --recv 06E85760C0A52C50 | ||
| + | apt update && apt install unifi -y | ||
| + | #### ERRORS ##### | ||
| + | </ | ||
| + | |||
| + | <code bash> | ||
| + | wget https:// | ||
| + | chmod +x unifi-7.1.66.sh | ||
| + | ./ | ||
| + | systemctl status unifi | ||
| + | </ | ||
| + | ====== Previous _Failed_ Install ====== | ||
| + | |||
| + | <code bash> | ||
| + | sudo apt-get update && sudo apt-get install ca-certificates apt-transport-https | ||
| + | echo 'deb https:// | ||
| + | wget -qO - https:// | ||
| + | echo "deb https:// | ||
| + | sudo apt-get update | ||
| + | sudo wget -O / | ||
| + | sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 06E85760C0A52C50 | ||
| + | sudo apt-get update && sudo apt-get install unifi -y | ||
| + | systemctl enable --now unifi | ||
| + | apt install default-jre | ||
| + | </ | ||
| + | Top shit -> doesn' | ||
| + | <code bash> wget https:// | ||
| + | dpkg -i unifi_sysvinit_all.deb | ||
| + | apt-get install -f | ||
| + | </ | ||
| + | doesn' | ||
| + | <code bash> wget https:// | ||
| + | bash unifi-6.5.55.sh </ | ||
| + | ===== Interface ===== | ||
| + | -> [[https:// | ||
| + | |||
| + | ===== Timezone ===== | ||
| + | <code bash> | ||
| + | timedatectl set-timezone Europe/ | ||
| + | timedatectl | ||
| + | |||
| + | </ | ||
| + | ===== NTP client ===== | ||
| + | |||
| + | <code bash>vi / | ||
| + | <code perl> | ||
| + | [Time] | ||
| + | NTP=ntp.fortier-family.com | ||
| + | </ | ||
| + | <code bash> | ||
| + | timedatectl status | ||
| + | systemctl restart systemd-timesyncd | ||
| + | </ | ||
| + | |||
| + | |||
| + | ===== NTP server (NOT DONE, now on another server) ===== | ||
| + | Why not? :-) | ||
| + | <code bash> | ||
| + | apt-get install ntp | ||
| + | sntp --version | ||
| + | vi / | ||
| + | choose a pool close : https:// | ||
| + | <code perl> | ||
| + | server 0.ch.pool.ntp.org | ||
| + | server 1.ch.pool.ntp.org | ||
| + | server 2.ch.pool.ntp.org | ||
| + | server 3.ch.pool.ntp.org | ||
| + | </ | ||
| + | <code bash> | ||
| + | systemctl status ntp</ | ||
| + | <code perl> | ||
| + | ...kernel reports TIME_ERROR: 0x2041: Clock Unsynchronized</ | ||
| + | <code bash> ufw allow from any to any port 123 proto udp</ | ||
| + | |||
| + | ===== Remove fucking cloud-init ===== | ||
| + | every reboot ... SSH Keys are regenerated !! How stoopid is that?! m( m( m( m( m( m( m( m( m( m( m( m( m( m( m( m( | ||
| + | <code bash>ssh 192.168.1.70 | ||
| + | @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ | ||
| + | @ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! | ||
| + | @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ | ||
| + | IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY! | ||
| + | Someone could be eavesdropping on you right now (man-in-the-middle attack)! | ||
| + | It is also possible that a host key has just been changed. | ||
| + | The fingerprint for the ED25519 key sent by the remote host is | ||
| + | SHA256: | ||
| + | Please contact your system administrator. | ||
| + | Add correct host key in / | ||
| + | Offending ECDSA key in / | ||
| + | Host key for 192.168.1.70 has changed and you have requested strict checking. | ||
| + | Host key verification failed.</ | ||
| + | |||
| + | <code bash> | ||
| + | dpkg-reconfigure cloud-init # None (28) | ||
| + | |||
| + | dpkg-reconfigure cloud-init | ||
| + | apt-get purge cloud-init | ||
| + | rm -rf /etc/cloud/ && sudo rm -rf / | ||
| + | </ | ||
| + | |||
| + | |||
| + | |||
| + | ====== Archlinux ====== | ||
| + | since Unifi is not providing statistics... Java Power !! Let's install it on Arch | ||
| + | Basic Archlinux Install | ||
| + | <code bash> | ||
| + | # create one partition for EFI + 1 for / | ||
| + | ==== UEFI de merde ==== | ||
| + | <code perl> | ||
| + | root@archiso ~ # gdisk /dev/sda | ||
| + | GPT fdisk (gdisk) version 1.0.8 | ||
| + | |||
| + | Partition table scan: | ||
| + | MBR: not present | ||
| + | BSD: not present | ||
| + | APM: not present | ||
| + | GPT: not present | ||
| + | |||
| + | Creating new GPT entries in memory. | ||
| + | |||
| + | Command (? for help): o | ||
| + | This option deletes all partitions and creates a new protective MBR. | ||
| + | Proceed? (Y/N): Y | ||
| + | |||
| + | Command (? for help): n | ||
| + | Partition number (1-128, default 1): | ||
| + | First sector (34-67108830, | ||
| + | Last sector (2048-67108830, | ||
| + | Current type is 8300 (Linux filesystem) | ||
| + | Hex code or GUID (L to show codes, Enter = 8300): EF00 | ||
| + | Changed type of partition to 'EFI system partition' | ||
| + | |||
| + | Command (? for help): n | ||
| + | Partition number (2-128, default 2): | ||
| + | First sector (34-67108830, | ||
| + | Last sector (1128448-67108830, | ||
| + | Current type is 8300 (Linux filesystem) | ||
| + | Hex code or GUID (L to show codes, Enter = 8300): | ||
| + | Changed type of partition to 'Linux filesystem' | ||
| + | |||
| + | Command (? for help): p | ||
| + | Disk /dev/sda: 67108864 sectors, 32.0 GiB | ||
| + | Model: QEMU HARDDISK | ||
| + | Sector size (logical/ | ||
| + | Disk identifier (GUID): 2B7EBB37-FD6B-495E-8DFF-A2B02184B4BA | ||
| + | Partition table holds up to 128 entries | ||
| + | Main partition table begins at sector 2 and ends at sector 33 | ||
| + | First usable sector is 34, last usable sector is 67108830 | ||
| + | Partitions will be aligned on 2048-sector boundaries | ||
| + | Total free space is 2014 sectors (1007.0 KiB) | ||
| + | |||
| + | Number | ||
| + | | ||
| + | | ||
| + | |||
| + | Command (? for help): w | ||
| + | Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING | ||
| + | PARTITIONS!! | ||
| + | |||
| + | Do you want to proceed? (Y/N): Y | ||
| + | OK; writing new GUID partition table (GPT) to /dev/sda. | ||
| + | The operation has completed successfully. | ||
| + | </ | ||
| + | <code bash> | ||
| + | mkfs.ext4 -L ROOT /dev/sda2 | ||
| + | mkfs.vfat -F32 -n EFI /dev/sda1 | ||
| + | mount /dev/sda2 /mnt | ||
| + | mkdir /mnt/boot | ||
| + | mount /dev/sda1 /mnt/boot | ||
| + | pacstrap /mnt linux-hardened base base-devel intel-ucode vim linux-firmware dhcpcd networkmanager git openssh go net-snmp wget | ||
| + | genfstab -U /mnt >> / | ||
| + | arch-chroot /mnt/ | ||
| + | ===== Config ===== | ||
| + | echo " | ||
| + | echo LANG=en_US.UTF-8 > / | ||
| + | ln -s `which vim` /usr/bin/vi | ||
| + | </ | ||
| + | <code bash> | ||
| + | vi / | ||
| + | #uncomment # | ||
| + | </ | ||
| + | <code bash> | ||
| + | locale-gen | ||
| + | echo KEYMAP=us-acentos > / | ||
| + | echo FONT=lat9w-16 >> / | ||
| + | ln -sf / | ||
| + | echo "#< | ||
| + | 127.0.0.1 monitor.localdomain monitor" | ||
| + | |||
| + | ==== Init/boot ==== | ||
| + | <code bash> | ||
| + | vi / | ||
| + | # HOOKS=(base keyboard udev autodetect modconf block keymap filesystems) | ||
| + | </ | ||
| + | <code bash> | ||
| + | mkinitcpio -p linux-hardened | ||
| + | bootctl --path=/ | ||
| + | </ | ||
| + | * / | ||
| + | <code perl> | ||
| + | title Arch Linux | ||
| + | linux / | ||
| + | initrd / | ||
| + | initrd / | ||
| + | options root=" | ||
| + | * / | ||
| + | <code perl> | ||
| + | default | ||
| + | timeout | ||
| + | console-mode max | ||
| + | # | ||
| + | </ | ||
| + | <code bash> | ||
| + | </ | ||
| + | ==== post install ==== | ||
| + | <code bash> | ||
| + | <code bash> | ||
| + | === AUR Helper === | ||
| + | <code bash> | ||
| + | su - warnaud | ||
| + | cd /tmp | ||
| + | mkdir yay | ||
| + | curl https:// | ||
| + | cd yay | ||
| + | makepkg | ||
| + | su | ||
| + | pacman -U yay*.zst | ||
| + | </ | ||
| + | === Static IP === | ||
| + | <code bash>vi / | ||
| + | <code perl> | ||
| + | [Match] | ||
| + | Name=ens192 | ||
| + | |||
| + | [Network] | ||
| + | Address=192.168.1.60/ | ||
| + | Gateway=192.168.1.1 | ||
| + | DNS=192.168.1.10 | ||
| + | DNS=192.168.1.11 | ||
| + | </ | ||
| + | <code bash> | ||
| + | |||
| + | |||
| + | ====== Reference ====== | ||
| + | |||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
