====== Ubuntu ======
===== User administrieren =====
#create new user 'newuser'
sudo adduser newuser
#show current groups
groups newuser
#Public Key in ''~/.ssh/authorized_keys'' eintragen
#grand sudo rights (by adding user to group sudo)
sudo usermod -aG sudo newuser
#deletes user and removes home directory
sudo deluser --remove-home newuser
===== Hostname ändern =====
sudo hostnamectl set-hostname NEUERNAME
===== Manuelle Netzwerkonfiguration (Netplan) =====
1. Netzwerkinterface herausfinden (:!:muss in der Config angepasst werden!):
ip link
2. Datei ''/etc/netplan/01-netcfg.yaml'' anlegen/bearbeiten:
network:
version: 2
renderer: networkd
ethernets:
ens3:
dhcp4: no
addresses:
- 141.45.184.42/25
routes:
- to: default
via: 141.45.184.1
nameservers:
addresses: [8.8.8.8, 9.9.9.9]
3. Zugriff beschränken:
chmod 600 /etc/netplan/01-netcfg.yaml
3. Netplan anwenden und Config überprüfen:
sudo netplan apply
ip addr show dev ens3
===== DNS-Server konfigurieren (ohne Netplan) =====
Create:
sudo mkdir /etc/systemd/resolved.conf.d/
sudo vim /etc/systemd/resolved.conf.d/dns_servers.conf
Insert lines into ''dns_servers.conf'':
[Resolve]
DNS=9.9.9.9 8.8.8.8
Restart ''systemd-resolved'':
sudo systemctl restart systemd-resolved
Source: https://askubuntu.com/questions/1406827/how-to-set-dns-on-ubuntu-22-04-when-you-have-no-netplan-config
===== Wake-on-LAN konfigurieren =====
* https://kodi.wiki/view/HOW-TO:Set_up_Wake-on-LAN_for_Ubuntu#cite_note-1
:!: WoL als Systemd - Service (16.04):
* https://askubuntu.com/questions/764158/how-to-enable-wake-on-lan-wol-in-ubuntu-16-04
* [[https://apple.stackexchange.com/questions/95246/wake-other-computers-from-mac-osx|Python Script für MagicPacket]]
===== Verschlüsselung der Home-Partition aufheben: =====
* https://askubuntu.com/questions/107410/can-you-unencrypt-remove-encryption-from-a-user-home-folder
* http://virtually-a-machine.blogspot.com/2010/08/howto-disable-ecryptfs.html
:!: vor dem Kopieren muss das Home-Verzeichnis schreibbar gemacht werden (Permissions: 700)
===== Hardening Ubuntu: =====
* https://gist.github.com/lokhman/cc716d2e2d373dd696b2d9264c0287a3
* https://bookofzeus.com/harden-ubuntu/hardening/sysctl-conf/
===== IPv6 in Ubuntu manuell konfigurieren =====
==== Zielkonfiguration ====
''2001:db8:333::2/64 auf eth0\\
2001:db8:333::1/64 ist der Router/Gateway''
==== IPv6-Adresse an Interface binden ====
Enable IPv6 (wenn nötig): ''$ sudo modprobe ipv6''
sudo ip addr add 2001:db8:333::3/64 dev eth0
oder:
sudo ip -f inet6 address add 2001:db8:333::3/64 dev eth0
==== Default Route eintragen ====
sudo ip -6 route add ::/0 via 2001:db8:333::1
==== Konfiguration prüfen ====
Anzeigen der an die Interfaces gebundenen Adressen:
ip a
Anzeigen der Routen
netstat -6nr # IPv6 Routen
netstat -nr # IPv4 Routen