# Setup Intel NUC
1. Select Ubuntu Version from ubuntu.com
2. plug in USB stick and open Disk Utility
3. select it and click Erase (copy everything in it to a safe place first)
4. Use Etcher and upload Ubuntu ISO
5. select the USB stick and press Flash
6. Plug USB stick to NUC
7. Plug in NUC. Attach to monitor, keyboard will work if it is plugged into the monitor
8. Select Install Ubuntu Server and go through setup process
9. Select Docker and install it
10. For temp wifi access plug the NUC into the router ethernet cable before starting setup
11. enable wifi [Answer](https://askubuntu.com/questions/1255866/how-to-enable-wireless-on-ubuntu-server-20-04-via-cli)
```
#determine if the kernel even recognizes the WIFI interface
nmcli d
#Is WIFI on? Should be default
ncmli r wifi on
#Connect
nmcli d wifi connect WIFI-NAME password PASSWOR
```
### Setting up SSH
[Add public SSH key to server](https://linuxhandbook.com/add-ssh-public-key-to-server/)
`ssh-copy-id -i ~/.ssh/id_rsa.pub username@ip`
### how to become root
`sudo -i`
how to exit out of root
`exit`
### how to add a user account
1. become root with `sudo -i`
2. create a user with `useradd username`
3. set user's password with `passwd username`
4. create user's home folder with `mkhomedir_helper username`
Add user to sudo group
`sudo gpasswd -a username sudo`
the user has to be logged out first
how to list user accounts on linux
`cat /etc/passwd`
**TIP** check `whoami` on your comp and if your whoami username matches the new user account you can just do `ssh serverip`!
### add user to sudo group
`usermod -aG sudo username`
check groups user is in
`groups username`
https://askubuntu.com/questions/521591/user-in-sudo-group-cannot-use-sudo-command
#### check for apps running on ports
`sudo netstat -tulpn | grep LISTEN`
### Check for Partitions etc
`fdisk -l` lists partitions
Why does it say nvme instead of sda? [Answer](https://askubuntu.com/questions/932331/filesystem-shows-dev-nvme0n1p1-instead-of-dev-sda)
### Fixes for Issues
If you get a 'WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!' Error [[Answer](https://www.digitalocean.com/community/questions/warning-remote-host-identification-has-changed)]
If unable to connect to SSH [[Answer](https://askubuntu.com/questions/364935/ping-works-but-unable-to-do-ssh)] TL;DR remove openssh-client and server, then reinstall with apt-get
## Notes
- Ubuntu Server Version is similar to desktop but command line only (no GUI)
- do `cd /` if you can't find anything in the starter directory
- YAML files require two spaces as indentation (not tabs)
```
sudo addgroup --system docker
sudo adduser username docker
newgrp docker
sudo snap disable docker
sudo snap enable docker
```
### add user to sudoers
```bash=
usermod -aG sudo username
```
### change password
```bash=
passwd
```