Håvard O. Nordstrand 5 년 전
부모
커밋
bc7069c164
2개의 변경된 파일18개의 추가작업 그리고 20개의 파일을 삭제
  1. 16 17
      config/linux-server/debian.md
  2. 2 3
      config/linux-server/storage.md

+ 16 - 17
config/linux-server/debian.md

@@ -90,16 +90,27 @@ breadcrumbs:
 1. Update MOTD:
     - Clear `/etc/motd` and `/etc/issue`.
     - (Optional) Add a MOTD script (see below).
-1. (Not recommended) Prevent root login:
-    - Alternatively, keep it enabled with a strong password as a local backdoor for recovery or similar.
-    - Add a personal user first.
-    - Check that the password field (the second field) for root in `/etc/shadow` is something invalid like "\*" or "!", but not empty and not valid password hash. This prevents password login.
-    - Clear `/etc/securetty` to prevent root local/console login.
+1. (Optional) Set up a swap file:
+    1. (Note) Avoid using swapping if possible. If you really need it but don't intend on using it too often (e.g. for hibernation), consider putting it on a larger, slower disk.
+    1. Show if swap is already enabled: `swapon --show`
+    1. Allocate the swap file: `fallocate -l <size> /swapfile`
+        - Alternatively, use dd.
+    1. Fix the permissions: `chmod 600 /swapfile`
+    1. Setup the swap file: `mkswap /swapfile`
+    1. Activate the swap file: `swapon /swapfile`
+        - Check: `swapon --show`
+    1. Add it to fstab using this line: `/swapfile swap swap defaults 0 0`
+        - Check: `mount -a`
 1. (Optional) Enable persistent logging:
     - The default journal directory is `/var/log/journal`. By default, it's not automatically created.
     - In `/etc/systemd/journald.conf`, under `[Journal]`, set `Storage=persistent`.
     - `auto` (the default) is like `persistent` but does not automatically create the log directory.
 1. (Recommended) Postfix mail relay: See [Linux Server Applications: Postfix](../applications/#postfix) (satellite system).
+1. (Not recommended) Prevent root login:
+    - Alternatively, keep it enabled with a strong password as a local backdoor for recovery or similar.
+    - Add a personal user first.
+    - Check that the password field (the second field) for root in `/etc/shadow` is something invalid like "\*" or "!", but not empty and not valid password hash. This prevents password login.
+    - Clear `/etc/securetty` to prevent root local/console login.
 
 ### Machine-Specific Configuration
 
@@ -115,18 +126,6 @@ breadcrumbs:
 1. Install `smartmontools` and run `smartctl -s on <dev>` for all physical drives to enable SMART monitoring.
 1. Install `lm-sensors` and run `sensors-detect` to detect temperatur sensors etc. Add the modules to `/etc/modules` when asked.
 1. Mask `ctrl-alt-del.target` to disable CTRL+ALT+DEL reboot at the login screen.
-1. (Optional) Set up a swap file:
-    1. (Note) Avoid using swapping if possible. If you really need it but don't intend on using it too often (e.g. for hibernation), consider putting it on a larger, slower disk.
-    1. Show if swap is already enabled: `swapon --show`
-    1. Allocate the swap file: `fallocate -l <size> /swapfile`
-        - Alternatively, use dd.
-    1. Fix the permissions: `chmod 600 /swapfile`
-    1. Setup the swap file: `mkswap /swapfile`
-    1. Activate the swap file: `swapon /swapfile`
-        - Check: `swapon --show`
-    1. Add it to fstab using this line: `/swapfile swap swap defaults 0 0`
-        - Check: `mount -a`
-    1. (Optional) Reduce swappiness: Add `vm.swappiness = 10` to `/etc/sysctl.conf`.
 
 #### QEMU Virtual Host
 

+ 2 - 3
config/linux-server/storage.md

@@ -36,7 +36,6 @@ breadcrumbs:
     - Most modern tools on modern Linux versions will automatically align file systems and partitions correctly.
     - The `relatime` mount flag is set by default, to reduce disk writes when a file is read.
     - For SSDs, don't enable TRIM (using neither the `discard` mount option nor `fstrim.timer`). TRIM typically don't provide much benefit and may actually reduce performance. Since SSDs are generally overprovisioned and may be overprovisioned further by the user (generally not needed), TRIM is generally not needed any more.
-    - `vm.swappiness` should possibly be set to some reasonable value to reduce swapping pressure on the swap disk(s).
 
 ### SSDs
 
@@ -95,9 +94,9 @@ This is just a suggestion for how to partition your main system drive. Since LVM
 | `/proc` | Runtime | N/A | hidepid=2,gid=1500 |
 | `/boot/efi` | FAT32 w/ boot flag (UEFI), none (BIOS) | 0.5 | nodev,nosuid,noexec |
 | `/boot` | EXT4 (UEFI), FAT32 w/ boot flag (BIOS) | 0.5 | nodev,nosuid,noexec |
-| Swap | Swap (optional) | 4, 8, 16 | N/A |
+| Swap | Swap (optional) | N/A | N/A |
 | `vg0` | LVM | 50% or 100% | N/A |
-| Swap | Swap (LVM) (optional) | 4, 8, 16 | N/A |
+| Swap | Swap (LVM) (optional) | N/A | N/A |
 | `/` | EXT4 (LVM) | 10 | nodev |
 | `/tmp` | EXT4 (LVM) | 5 | nodev,nosuid,noexec |
 | `/var` | EXT4 (LVM) | 5 | nodev,nosuid |