Ich verwende die Anwendung “shutter” zum Erstellen und Bearbeiten
von Bildschirmfotos. Leider kann ich mit Ubuntu-18.04 die Bildschirmfotos
nicht bearbeiten, der Aktionsknopf ist ausgegraut.
Ich habe einen Hetzner-Server über die Serverbörse bestellt und meinen SSH-Schlüssel registriert.
Auf dem Rettungssystem kann ich mich damit anmelden:
12345678910111213141516171819202122232425262728
$ ssh root@8.145.3.2
The authenticity of host '8.145.3.2 (8.145.3.2)' can't be established.
ECDSA key fingerprint is ee:fd:95:77:cc:f4:9c:5d:3c:22:10:39:8a:8e:80:55.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '8.145.3.2' (ECDSA) to the list of known hosts.
-------------------------------------------------------------------
Welcome to the Hetzner Rescue System.
...
-------------------------------------------------------------------
Rescue System up since 2019-10-15 08:11 +02:00
Hardware data:
CPU1: Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz (Cores 8)
Memory: 32086 MB
Disk /dev/sda: 3000 GB (=> 2794 GiB) doesn't contain a valid partition table
Disk /dev/sdb: 3000 GB (=> 2794 GiB) doesn't contain a valid partition table
Total capacity 5589 GiB with 2 Disks
Network data:
eth0 LINK: yes
MAC: d8:80:11:22:33:44
IP: 8.145.3.2
IPv6: 2e01:5e3:111:2222::2/64
RealTek RTL-8169 Gigabit Ethernet driver
Server ist sehr langsam
Während der Installation und eine ganze Weile danach habe
ich den Eindruck, dass der Server sehr langsam ist. Insbesondere
wenn Datenbereiche kopiert werden, dauert das ewig.
Sichtung von “/proc/mdstat” zeigt, dass der Resync des von mir
verwendeten Raid1 noch im Gange ist:
Nachdem der Resync fertig ist, sollte der Rechner dauerhaft mit der üblichen Geschwindigkeit funktionieren!
Installation Minimal-Ubuntu
Zuerst installieren wir ein Minimal-Ubuntu.
Das Minimal-Ubuntu läuft ohne Verschlüsselung und
wird später in die verschlüsselten Plattenbereiche
umkopiert.
Anmelden am Rettungssystem
12345678
desktop:~$ ssh root@8.145.3.2
-------------------------------------------------------------------
Welcome to the Hetzner Rescue System.
...
-------------------------------------------------------------------
...
rescue:/#
rescue:/# vgremove vg0
Do you really want to remove volume group "vg0" containing 2 logical volumes? [y/n]: y
Do you really want to remove active logical volume vg0/swap? [y/n]: y
Logical volume "swap" successfully removed
Do you really want to remove active logical volume vg0/root? [y/n]: y
Logical volume "root" successfully removed
Volume group "vg0" successfully removed
final:/# update-grub
Sourcing file `/etc/default/grub'
Generating grub configuration file ...
WARNING: Failed to connect to lvmetad. Falling back to device scanning.
WARNING: Failed to connect to lvmetad. Falling back to device scanning.
WARNING: Failed to connect to lvmetad. Falling back to device scanning.
WARNING: Failed to connect to lvmetad. Falling back to device scanning.
WARNING: Failed to connect to lvmetad. Falling back to device scanning.
WARNING: Failed to connect to lvmetad. Falling back to device scanning.
WARNING: Failed to connect to lvmetad. Falling back to device scanning.
WARNING: Failed to connect to lvmetad. Falling back to device scanning.
WARNING: Failed to connect to lvmetad. Falling back to device scanning.
WARNING: Failed to connect to lvmetad. Falling back to device scanning.
Found linux image: /boot/vmlinuz-4.15.0-65-generic
Found initrd image: /boot/initrd.img-4.15.0-65-generic
WARNING: Failed to connect to lvmetad. Falling back to device scanning.
WARNING: Failed to connect to lvmetad. Falling back to device scanning.
done
final:/# grub-install /dev/sda
Installing for i386-pc platform.
Installation finished. No error reported.
final:/# grub-install /dev/sdb
Installing for i386-pc platform.
Installation finished. No error reported.
desktop:~$ ssh -o UserKnownHostsFile=/dev/null root@8.145.3.2
The authenticity of host '8.145.3.2 (8.145.3.2)' can't be established.
ECDSA key fingerprint is ee:fd:95:77:cc:f4:9c:5d:3c:22:10:39:8a:8e:80:55.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '8.145.3.2' (ECDSA) to the list of known hosts.
To unlock root partition, and maybe others like swap, run `cryptroot-unlock`
BusyBox v1.27.2 (Ubuntu 1:1.27.2-2ubuntu3.2) built-in shell (ash)
Enter 'help' for a list of built-in commands.
# cryptroot-unlock
Please unlock disk cryptroot (/dev/md1): {meinKennwort}
Error: Timeout reached while waiting for PID 388.
# exit
desktop:~$ ssh root@8.145.3.2
sb35:/# cryptsetup luksAddKey /dev/md1
Enter any existing passphrase: {keinKennwort}
Enter new passphrase for key slot: Porsche911_{geheimerZweiterTeil}
Verify passphrase: Porsche911_{geheimerZweiterTeil}
#!/bin/sh
#
#
# This is an example hook script. It will be run by 'mkinitramfs'
# when it creates the image. It's job is to decide which files to
# install, then install them into the staging area, where the
# initramfs is being created. This happens when a new 'linux-image'
# package is installed, or when the administrator runs 'mkinitramfs'
# by hand to update an initramfs image.
#
# CONFDIR -- usually /etc/initramfs-tools, can be set on mkinitramfs
# command line.
#
# DESTDIR -- The staging directory where we are building the image.
#
# see initramfs-tools(8)
#
# List the soft prerequisites here. This is a space separated list of
# names, of scripts that are in the same directory as this one, that
# must be run before this one can be.
#
PREREQ=""
prereqs()
{
echo "$PREREQ"
}
case $1 in
# get pre-requisites
prereqs)
prereqs
exit 0
;;
esac
# You can do anything you need to from here on.
#
# Source the optional 'hook-functions' scriptlet, if you need the
# functions defined within it. Read it to see what is available to
# you. It contains functions for copying dynamically linked program
# binaries, and kernel modules into the DESTDIR.
#
. /usr/share/initramfs-tools/hook-functions
copy_file binary "${CONFDIR}/unlock-disks.sh" "/bin"
exit 0
desktop:~$ ssh root@8.145.3.2
sb35:/# reboot
Connection to 8.145.3.2 closed by remote host.
Connection to 8.145.3.2 closed.
desktop:~$ echo "Porsche911"|ssh -o UserKnownHostsFile=knownHosts-boot root@8.145.3.2 /bin/unlock-disks.sh
The authenticity of host '8.145.3.2 (8.145.3.2)' can't be established.
ECDSA key fingerprint is 68:...
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '8.145.3.2' (ECDSA) to the list of known hosts.
Please unlock disk cryptroot (/dev/md1)
Error: Timeout reached while waiting for PID 394.
desktop:~$ ssh root@8.145.3.2
Welcome to Ubuntu 18.04.3 LTS (GNU/Linux 4.15.0-65-generic x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
...
sb35:/#
Weitere SSH-Schlüssel für den Boot-Vorgang freischalten
Datei “etc/dropbear-initramfs/authorized_keys” erweitern um den PubKey:
Hier beschreibe ich, wie ich einen Rechner mit
Ubuntu-18.04.3 einrichte. Ich gehe grob nach dieser Anleitung
vor, allerdings mit separater, unverschlüsselter Boot-Partition.
Verschlüsselte Boot-Partition hat bei mir nicht funktioniert!
Hier beschreibe ich, wie ich auf einem Rechner mit
Ubuntu-18.04 die Oberfläche eines Android-Telefons
in ein Fenster spiegle. Das Telefon kann anschließend
mittels Tastatur und Maus bedient werden:
Vorbereitungen am Handy
Nachfolgendes habe ich an einem Sony Xperia XZ mit Android 8.0
durchgespielt:
Developer-Modus aktivieren
Einstellungen
System
Über das Telefon
Build-Nummer: “Oft” draufdrücken (8 mal?)
USB-Debugging aktivieren
Einstellungen
System
Entwickleroptionen
USB-Debugging: Aktivieren
Vorbereitung am Linux-Rechner
SCRCPY installieren: sudo snap install scrcpy (dauert eine ganze Weile)
ADB installieren: sudo apt install adb
Kopplung und Programmstart
Handy und Rechner per USB koppeln
Handy: “Laden” anwählen
Rechner: scrcpy starten
Handy: Debugging zulassen
Rechner: Die Oberfläche vom Handy erscheint
Die Größe kann am Fensterrahmen geändert werden!
Wenn man das Handy dreht, dann dreht sich auch das Fenster!
Bedienung via Tastatur und Maus klappt!
Umlaute per Tastatur funktionieren bei mir im Moment nicht!
# Ermitteln: Welche /dev/sdX-Datei gehört zum USB-Stick?
# -> Bei mir: /dev/sdb [WICHTIG! NICHT "RATEN"!]
dd if=ubuntu-18.04.2-...iso of=/dev/sdb
Installation durchführen
Von USB starten
Bei UEFI-PCs: “Textoberfläche” muß sichtbar sein für das Boot-Menü!
Wenn’s grafisch aussieht, dann startet der USB-Stick im BIOS-Modus,
das sorgt für Probleme!
Installation – Komplette Platte mit verschlüsseltem LVM
Hinweis: Die Platte vom ASUS-Laptop wurde “frühzeitig” überschrieben, also
nicht erst nach “Änderungen auf die Festplatten schreiben?” Man kann sich
nicht drauf verlassen, dass vor “fatalen” Änderungen an der Festplatte eine
Sicherheitsabfrage erfolgt!
sudo -s
mount /dev/ubuntu-vg/home /mnt
cd /mnt
cp -a /home/* .
# /etc/fstab editieren
reboot
Wechsel der Loginshell auf bash-Shell
Auswahl der bash-Shell als Standard-Loginshell (z.B. damit im Terminal History und Pfad vervollständigen funktionieren)
* chsh
* PW eingeben
* aktuelle Shell wird vorgeschlagen, neue Shell angeben mit
/bin/bash
* Benutzer abmelden und komplett neu anmelden
Touchpad: Rechte Ecke aktivieren
damit re Mausklick durch Auswahl der re Ecke des kleinen Touchpads möglich ist
12
sudo apt-get install gnome-tweaks
gnome-tweaks
–> Dort Einstellungen > Tastatur und Maus > “Bereich” auswählen
Manchmal passiert es mir, dass ich einen Benutzer mit
den falschen Aufrufoptionen anlege und dieser so kein
Home-Verzeichnis angelegt bekommt:
1234
$ sudo useradd {benutzername}
# Option "-m" vergessen
$ ls /home/{benutzername}
ls: Zugriff auf /home/{benutzername} nicht möglich: Datei oder Verzeichnis nicht gefunden
Das kann man leicht korrigieren mit dem Skript “mkhomedir_helper”: