ABDURROZAK
HOME ABOUT ME MICROSITE KONTAK PERSEMBAHAN HELP
ABDURROZAK.MY.ID // DEBIAN SERVER ESSENTIALS

DEBIAN SERVER ESSENTIALSFROM FUNDAMENTAL TO ADMIN

Panduan komprehensif 17 volume dari fundamental Linux hingga server administration. Setiap command dan script dilengkapi penjelasan detail per parameter. Dari install Debian hingga troubleshooting, semua dibahas tuntas dengan contoh praktis.

VOLUMES17
BAB50+
BACA20+ JAM
OSDebian 12
ABDUR ROZAK, S.Kom. Web Developer & System Administrator - abdurrozak.my.id
ABDURROZAK.MY.ID // DAFTAR VOLUME

17 VOLUME SERI LENGKAP

Pilih volume untuk mulai belajar

VOLUME 01
LINUX & DEBIAN FUNDAMENTALS
Sejarah Linux, filosofi, arsitektur kernel, dan mengapa Debian.
FONDASI
VOLUME 02
INSTALLING DEBIAN SERVER
Netinstall, partisi, konfigurasi dasar pasca-install.
INSTALL
VOLUME 03
COMMAND LINE ESSENTIALS
Navigasi, file, text processing, piping, redirection.
CLI
VOLUME 04
FILE SYSTEM & STORAGE
FHS, mount, fstab, LVM, disk management.
STORAGE
VOLUME 05
USER, GROUP & PERMISSIONS
User management, chmod, chown, ACL, sudo.
ACCESS
VOLUME 06
APT & PACKAGE MANAGEMENT
apt, dpkg, repository, source list, package lifecycle.
PACKAGE
VOLUME 07
NETWORKING FUNDAMENTALS
Interfaces, IP, routing, DNS, netplan, ip command.
NETWORK
VOLUME 08
SSH & REMOTE ADMIN
SSH server/client, key-based auth, config, tunneling.
REMOTE
VOLUME 09
PROCESS, SERVICE & SYSTEMD
ps, top, systemctl, service management, unit files.
SERVICE
VOLUME 10
MONITORING & LOGS
top, htop, journalctl, log rotation, performance.
MONITOR
VOLUME 11
WEB SERVER FUNDAMENTALS
Apache, Nginx, virtual hosts, SSL/TLS, PHP-FPM.
WEB
VOLUME 12
DATABASE SERVER
MariaDB, PostgreSQL, backup, replication, tuning.
DATABASE
VOLUME 13
DNS & DHCP SERVER
BIND9, dnsmasq, isc-dhcp-server, forwarders.
INFRA
VOLUME 14
FILE SHARING SERVER
Samba (SMB/CIFS), NFS, WebDAV, permissions.
SHARE
VOLUME 15
SERVER SECURITY
UFW, fail2ban, AppArmor, hardening, audit.
SECURITY
VOLUME 16
BACKUP & RECOVERY
rsync, tar, borg, timeshift, disaster recovery.
BACKUP
VOLUME 17
TROUBLESHOOTING
Diagnostic, common issues, recovery, best practice.
DIAGNOSTIC
VOLUME 01 / 17

LINUX & DEBIAN FUNDAMENTALS

Fondasi semua server Linux. Memahami sejarah Linux, filosofi open source, arsitektur kernel, keluarga distro, dan mengapa Debian menjadi pilihan utama untuk server production.
SUB-BAB4 LEVELFondasi WAKTU40 MENIT
1.1
VOLUME 01 FUNDAMENTAL

SEJARAH & FILOSOFI LINUX

Sejarah Singkat

Linux adalah kernel open-source yang diciptakan oleh Linus Torvalds pada tahun 1991 saat ia masih mahasiswa di Universitas Helsinki, Finlandia. Awalnya hanya hobi, Linux kini menjadi kernel yang menjalankan 96.3% server di dunia, 100% superkomputer tercepat, dan miliaran perangkat Android.

Linux dibangun di atas fondasi UNIX (diciptakan Bell Labs tahun 1969). Linus mengambil filosofi UNIX "do one thing and do it well" dan mengembangkannya dengan lisensi GPL (GNU Public License) yang menjamin kebebasan:

KEBEBASAN MENJALANKAN
Program bisa dijalankan untuk tujuan apa saja
KEBEBASAN MEMPELAJARI
Source code harus tersedia untuk dipelajari
KEBEBASAN MENDISTRIBUSI
Copy bisa dibagikan ke siapa saja
KEBEBASAN MEMODIFIKASI
Modifikasi bisa didistribusikan

Arsitektur Linux

LAYERKOMPONENFUNGSI
HardwareCPU, RAM, Disk, NICPhysical resources
KernelLinux KernelJembatan hardware-software, process management, memory, device driver
ShellBash, Zsh, FishCommand interpreter, user interface CLI
System Librariesglibc, coreutilsFungsi standar untuk aplikasi
ApplicationsApache, MySQL, NginxSoftware yang menjalankan tugas spesifik
Desktop EnvironmentGNOME, KDE (opsional)GUI untuk desktop (server biasanya tanpa GUI)
KUNCI: Yang disebut "Linux" sebenarnya adalah kernel. Sistem operasi lengkap (Linux + GNU tools + aplikasi) sering disebut GNU/Linux. Tapi untuk kesederhanaan, kita tetap pakai istilah "Linux".
KOMPETENSI SUB-BAB 1.1
  • Memahami sejarah dan filosofi Linux
  • Menjelaskan 4 kebebasan GPL
  • Mengenal arsitektur Linux (hardware - kernel - shell - apps)
1.2
VOLUME 01 FUNDAMENTAL

KELUARGA DISTRO LINUX

Distro Keluarga Debian

Distro (distribusi) adalah paket lengkap Linux: kernel + tools + package manager + aplikasi. Ada ratusan distro, tapi semuanya berasal dari beberapa keluarga besar:

KELUARGAPACKAGE MANAGERCONTOH DISTROUSE CASE
DebianAPT (apt, dpkg)Debian, Ubuntu, Linux Mint, KaliServer, desktop, security
Red HatRPM (dnf, yum)RHEL, Fedora, CentOS, RockyEnterprise server
ArchpacmanArch, Manjaro, EndeavourOSAdvanced user, rolling release
SUSEZypperopenSUSE, SLESEnterprise, desktop
IndependentBervariasiSlackware, Gentoo, AlpineSpecialized use case

Mengapa Debian untuk Server?

STABIL
Release cycle 2 tahun, testing ketat. Debian Stable adalah salah satu OS paling stabil di dunia.
AMAN
Tim security responsif, update keamanan cepat, default configuration aman.
PAKET LENGKAP
60,000+ package di repository resmi. Hampir semua software tersedia.
RINGAN
Bisa jalan di RAM 256MB. Minimal resource usage, cocok untuk VPS kecil.
KOMUNITAS BESAR
Dokumentasi lengkap, forum aktif, ribuan tutorial online.
100% GRATIS
Tidak ada biaya lisensi. Cocok untuk budget terbatas.

Debian Release Cycle

BRANCHSTATUSUPDATEUSE CASE
StableProduction-readySecurity & critical bug fixes onlyServer production
TestingCalon stable berikutnyaRegular updatesPre-production testing
Unstable (Sid)Rolling developmentDaily updatesDeveloper, testing
ExperimentalBleeding edgeVery frequentPackage development
UNTUK SERVER: Selalu gunakan Debian Stable. Testing dan Unstable tidak disarankan untuk production karena bisa break sewaktu-waktu. Debian 12 "Bookworm" adalah stable saat ini.
KOMPETENSI SUB-BAB 1.2
  • Mengenal keluarga besar distro Linux
  • Memahami perbedaan package manager tiap keluarga
  • Menjelaskan mengapa Debian cocok untuk server
  • Memahami release cycle Debian (Stable/Testing/Unstable)
1.3
VOLUME 01 FUNDAMENTAL

KERNEL LINUX DEEP DIVE

Fungsi Kernel

Kernel adalah inti sistem operasi. Ia bertugas menjembatani software dengan hardware. Fungsi utama kernel:

PROCESS MANAGEMENT
Membuat, menjadwalkan, mengakhiri process. Multi-tasking, multi-processing.
MEMORY MANAGEMENT
Alokasi RAM, virtual memory, paging, swapping.
DEVICE DRIVERS
Mengontrol hardware: disk, NIC, USB, GPU, dll.
FILE SYSTEM
Mendukung ext4, XFS, Btrfs, dll. Mount, unmount, VFS.
NETWORKING
TCP/IP stack, socket, routing, firewall (netfilter).
SECURITY
User permission, SELinux/AppArmor, namespaces, cgroups.

Cek Informasi Kernel

BASH
# Lihat versi kernel yang sedang berjalan uname -r ↳ -r = release, menampilkan versi kernel (contoh: 6.1.0-18-amd64) # Lihat semua informasi sistem uname -a ↳ -a = all, menampilkan kernel name, nodename, release, version, machine # Output: Linux debian-server 6.1.0-18-amd64 #1 SMP ... x86_64 GNU/Linux # Lihat detail kernel cat /proc/version ↳ /proc/version berisi info lengkap tentang kernel yang sedang berjalan # Lihat kernel modules yang dimuat lsmod ↳ Menampilkan daftar kernel modules (driver) yang sedang aktif # Lihat ring buffer kernel messages dmesg | less ↳ dmesg = display message, menampilkan log kernel (boot, hardware detection) ↳ | less = pipe ke less agar bisa scroll # Cari pesan error di dmesg dmesg -T | grep -i error ↳ -T = human-readable timestamp, grep -i = case-insensitive search
KOMPETENSI SUB-BAB 1.3
  • Memahami 6 fungsi utama kernel Linux
  • Mampu cek versi kernel dengan uname
  • Mampu melihat kernel messages dengan dmesg
1.4
VOLUME 01 FUNDAMENTAL

SHELL & BASH

Apa Itu Shell?

Shell adalah program yang menerima input dari user (command) dan menerjemahkannya untuk dijalankan oleh kernel. Shell adalah "juru bicara" antara user dan kernel.

SHELLPATHKARAKTERISTIK
bash/bin/bashDefault di Debian, paling populer, scripting powerful
sh/bin/shBourne shell, symlink ke bash di Debian, POSIX-compliant
zsh/bin/zshDefault di macOS, auto-completion canggih
fish/usr/bin/fishUser-friendly, syntax highlighting, tidak POSIX
dash/bin/dashCepat, ringan, untuk system scripts

Cek Shell yang Dipakai

BASH
# Lihat shell yang sedang aktif echo $SHELL ↳ $SHELL = environment variable yang menyimpan path shell default # Output: /bin/bash # Lihat shell saat ini (bisa berbeda dari default) echo $0 ↳ $0 = nama program yang sedang berjalan (shell saat ini) # Output: -bash # Lihat semua shell yang terinstall cat /etc/shells ↳ File /etc/shells berisi daftar shell valid di sistem # /bin/sh # /bin/bash # /usr/bin/bash # /bin/dash # Ganti shell default user chsh -s /bin/zsh ↳ chsh = change shell, -s = specify shell baru ↳ Perlu logout & login agar perubahan berlaku # Lihat shell untuk user tertentu grep "^username" /etc/passwd ↳ Field terakhir di /etc/passwd adalah shell default user

Prompt Bash

Saat buka terminal, kamu melihat prompt seperti ini:

root@debian-server:~#
BAGIANARTI
rootUsername yang login
@Pemisah
debian-serverHostname server
:Pemisah
~Current directory (~ = home directory)
#Root user (jika $ =普通 user)
PENTING: # = root (superuser), $ =普通 user. Selalu perhatikan prompt sebelum menjalankan command. Command berbahaya sebagai root bisa merusak sistem!
KOMPETENSI SUB-BAB 1.4
  • Memahami apa itu shell dan fungsinya
  • Mengenal berbagai jenis shell (bash, zsh, fish)
  • Mampu cek dan ganti shell default
  • Memahami struktur prompt bash
VOLUME 02 / 17

INSTALLING DEBIAN SERVER

Panduan lengkap install Debian Server dari netinstall ISO. Termasuk download ISO, pembuatan bootable USB, proses instalasi, partisi, konfigurasi dasar pasca-install, dan setup awal server.
SUB-BAB4 LEVELInstall WAKTU60 MENIT
2.1
VOLUME 02 INSTALL

DOWNLOAD & PERSIAPAN ISO

Jenis ISO Debian

TIPE ISOUKURANISIUSE CASE
netinst~400 MBMinimal, download package via internetServer (PALING DIREKOMENDASIKAN)
DVD-1~3.7 GBDesktop environment + banyak packageDesktop, offline install
BD-1~50 GBSemua package officialOffline install lengkap
live~3 GBLive system, bisa coba tanpa installTesting, demo
UNTUK SERVER: Gunakan netinst. Kecil, cepat download, dan hanya install package yang dibutuhkan. Hemat bandwidth dan disk space.

Download Debian

OFFICIAL LINK
# Website resmi Debian https://www.debian.org/ # Direct link Debian 12 (Bookworm) netinst https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/ # File yang didownload: # debian-12.5.0-amd64-netinst.iso # Verifikasi checksum (PENTING untuk keamanan!) sha256sum debian-12.5.0-amd64-netinst.iso ↳ Bandingkan output dengan SHA256SUMS di website ↳ Jika match, ISO tidak rusak/tidak dimodifikasi # Atau gunakan SHA512 (lebih aman) sha512sum debian-12.5.0-amd64-netinst.iso

Buat Bootable USB

OSTOOLCARA
WindowsRufus, EtcherDownload Rufus, pilih ISO, Write
Linuxdd, Etcherdd if=file.iso of=/dev/sdX bs=4M
macOSdd, Etcherdd if=file.iso of=/dev/rdiskN bs=4m
Cross-platformBalena EtcherGUI sederhana, 3 klik selesai
LINUX - DD COMMAND
# Cek nama USB drive (HATI-HATI, jangan salah disk!) lsblk ↳ Lihat daftar block device, cari USB (biasanya /dev/sdb atau /dev/sdc) # Unmount USB (jika auto-mounted) sudo umount /dev/sdb* ↳ Unmount semua partisi di USB # Write ISO ke USB (PERINGATAN: ini akan hapus semua data di USB!) sudo dd if=debian-12.5.0-amd64-netinst.iso of=/dev/sdb bs=4M status=progress ↳ if = input file (ISO) ↳ of = output file (USB drive, BUKAN partisi! /dev/sdb bukan /dev/sdb1) ↳ bs = block size 4MB (lebih cepat) ↳ status=progress = tampilkan progress # Sync untuk memastikan semua data tertulis sync
PERINGATAN: Command dd sangat powerful. Salah tulis of= bisa hapus data penting! Selalu double-check device name dengan lsblk.
KOMPETENSI SUB-BAB 2.1
  • Membedakan jenis ISO Debian (netinst, DVD, live)
  • Mampu download dan verifikasi checksum ISO
  • Mampu membuat bootable USB dengan Rufus/dd
2.2
VOLUME 02 INSTALL

PROSES INSTALASI

Langkah Instalasi

1
BOOT DARI USB

1. Colok USB ke server, nyalakan.

2. Masuk BIOS/UEFI (tekan F2/Del/F12 saat boot).

3. Set boot priority ke USB.

4. Pilih Graphical Install atau Install (text mode).

2
LANGUAGE, LOCATION, KEYBOARD

1. Language: English (direkomendasikan untuk server).

2. Location: Other → Asia → Indonesia.

3. Keyboard: English (US) atau sesuai preference.

3
NETWORK CONFIGURATION

1. Hostname: nama server (contoh: web-server, db-server).

2. Domain name: kosongkan jika tidak punya domain, atau isi domain lokal (contoh: local).

3. Network: pilih interface (eth0/ens33), pilih DHCP atau manual.

4
ROOT PASSWORD & USER

1. Root password: buat password kuat (12+ karakter, kombinasi).

2. Full name: nama user biasa (contoh: "Admin User").

3. Username: username untuk login (contoh: "admin").

4. Password: password user biasa.

5
PARTITIONING DISK

Pilih salah satu:

Guided - use entire disk (paling mudah, rekomended untuk pemula):

1. Pilih disk.

2. Pilih partitioning scheme:

SCHEMEPARTISIUSE CASE
All files in one partition/ (root) + swapServer sederhana
Separate /home partition/ + /home + swapDesktop, user data terpisah
Separate /home, /var, /tmp/ + /home + /var + /tmp + swapServer production (RECOMMENDED)

Manual (untuk advanced user):

Buat partisi manual sesuai kebutuhan. Contoh layout server:

PARTISISIZETYPEMOUNT POINT
sda1512 MBEFI System/boot/efi
sda21 GBext4/boot
sda320 GBext4/
sda420 GBext4/var
sda510 GBext4/tmp
sda6Remainingext4/home
sda72x RAMswap[swap]
6
PACKAGE SELECTION

Pilih software yang akan diinstall. Untuk server:

PACKAGEREKOMENDASI
[ ] Debian desktop environment❌ Uncheck (server tidak perlu GUI)
[ ] ... GNOME❌ Uncheck
[✓] web server✓ Check (jika butuh Apache/Nginx)
[✓] SSH server✓ Check (WAJIB untuk remote access)
[ ] standard system utilities✓ Check (basic tools)
7
GRUB BOOTLOADER

1. Install GRUB boot loader? → Yes.

2. Pilih device untuk install GRUB (biasanya /dev/sda).

3. Tunggu proses selesai.

4. Installation complete → Continue.

5. Cabut USB, reboot.

KOMPETENSI SUB-BAB 2.2
  • Mampu melakukan instalasi Debian dari awal sampai selesai
  • Memahami pilihan partisi untuk server
  • Mampu memilih package yang tepat untuk server
2.3
VOLUME 02 INSTALL

KONFIGURASI PASCA-INSTALL

Setup Awal Server

BASH
# 1. Login sebagai root atau user dengan sudo # Jika login sebagai user biasa, gunakan sudo untuk command root # 2. Update sistem (WAJIB setelah install) sudo apt update ↳ Update daftar package dari repository sudo apt upgrade -y ↳ Upgrade semua package ke versi terbaru ↳ -y = otomatis yes, tidak tanya konfirmasi sudo apt dist-upgrade -y ↳ Upgrade dengan smart conflict handling ↳ Bisa install/remove package jika perlu # 3. Install package penting sudo apt install -y sudo wget curl vim nano htop net-tools dnsutils ↳ sudo = untuk privilege escalation ↳ wget = download file dari internet ↳ curl = transfer data (HTTP, FTP, dll) ↳ vim/nano = text editor ↳ htop = task manager interaktif ↳ net-tools = ifconfig, netstat (legacy tools) ↳ dnsutils = dig, nslookup (DNS tools) # 4. Setup sudo untuk user biasa sudo usermod -aG sudo admin ↳ usermod = modify user ↳ -aG = append to group ↳ sudo = group yang punya akses sudo ↳ admin = username yang ditambah ke group sudo # 5. Konfigurasi timezone sudo timedatectl set-timezone Asia/Jakarta ↳ Set timezone ke WIB (Waktu Indonesia Barat) timedatectl ↳ Cek status waktu dan timezone # 6. Set hostname (jika ingin ganti) sudo hostnamectl set-hostname web-server ↳ Set hostname baru # 7. Konfigurasi /etc/hosts sudo nano /etc/hosts ↳ Edit file hosts untuk mapping hostname ke IP # Tambahkan baris: 127.0.1.1 web-server.local web-server # 8. Setup firewall dasar (UFW) sudo apt install ufw sudo ufw allow SSH ↳ Allow SSH (port 22) agar bisa remote sudo ufw allow 80/tcp ↳ Allow HTTP (untuk web server) sudo ufw allow 443/tcp ↳ Allow HTTPS sudo ufw enable ↳ Aktifkan firewall sudo ufw status ↳ Cek status firewall # 9. Disable root SSH login (security) sudo nano /etc/ssh/sshd_config # Cari baris: PermitRootLogin # Ubah menjadi: PermitRootLogin no sudo systemctl restart ssh ↳ Restart SSH service agar perubahan berlaku # 10. Reboot untuk pastikan semua berjalan sudo reboot
SETUP AWAL SELESAI: Server Debian sudah siap digunakan. Langkah selanjutnya: install service yang dibutuhkan (web server, database, dll) sesuai kebutuhan.
KOMPETENSI SUB-BAB 2.3
  • Mampu melakukan setup awal pasca-install
  • Mengerti pentingnya update sistem
  • Mampu setup sudo, timezone, hostname
  • Mampu konfigurasi firewall dasar (UFW)
VOLUME 03 / 17

LINUX COMMAND LINE ESSENTIALS

Menguasai command line Linux. Navigasi file system, manipulasi file & directory, text processing, piping, redirection, dan command essential lainnya yang wajib dikuasai sysadmin.
SUB-BAB5 LEVELCLI WAKTU75 MENIT
3.1
VOLUME 03 CLI

NAVIGASI & FILE SYSTEM

Navigasi Directory

BASH
# pwd - Print Working Directory (lihat current directory) pwd # /home/admin # cd - Change Directory (pindah directory) cd /var/log ↳ Pindah ke /var/log cd .. ↳ .. = parent directory (naik 1 level) cd ../.. ↳ Naik 2 level cd ~ ↳ ~ = home directory (cd tanpa argumen juga ke home) cd - ↳ - = previous directory (kembali ke directory sebelumnya) # ls - List (lihat isi directory) ls ↳ List file & directory di current directory ls -l ↳ -l = long format (detail: permission, owner, size, date) # -rw-r--r-- 1 admin admin 1234 Jan 15 10:30 file.txt ls -la ↳ -a = all (termasuk hidden file yang diawali .) ls -lh ↳ -h = human-readable (size dalam KB, MB, GB) ls -lt ↳ -t = sort by time (terbaru di atas) ls -lS ↳ -S = sort by size (terbesar di atas) ls -lR ↳ -R = recursive (list semua subdirectory) ls --color=auto ↳ Tampilkan dengan warna (file, directory, symlink berbeda warna)

Manipulasi File & Directory

BASH
# mkdir - Make Directory mkdir mydir ↳ Buat directory baru mkdir -p dir1/dir2/dir3 ↳ -p = parents, buat directory beserta parent-nya # touch - Buat file kosong atau update timestamp touch file.txt ↳ Buat file kosong. Jika file sudah ada, update timestamp # cp - Copy cp file.txt backup.txt ↳ Copy file cp -r dir1 dir2 ↳ -r = recursive, copy directory beserta isinya cp -i file.txt existing.txt ↳ -i = interactive, tanya sebelum overwrite # mv - Move/Rename mv old.txt new.txt ↳ Rename file mv file.txt /path/to/destination/ ↳ Pindah file ke directory lain mv -i file.txt existing.txt ↳ -i = tanya sebelum overwrite # rm - Remove rm file.txt ↳ Hapus file rm -r directory ↳ -r = recursive, hapus directory beserta isinya rm -rf directory ↳ -f = force, tidak tanya konfirmasi (HATI-HATI!) rm -i file.txt ↳ -i = interactive, tanya sebelum hapus # rmdir - Remove empty directory rmdir emptydir ↳ Hapus directory yang kosong saja
PERINGATAN: rm -rf sangat berbahaya! Salah ketik bisa hapus data penting. Selalu double-check path sebelum eksekusi. Pertimbangkan pakai rm -ri (interactive) untuk safety.
KOMPETENSI SUB-BAB 3.1
  • Mampu navigasi file system dengan cd, pwd, ls
  • Mampu buat, copy, move, rename, hapus file & directory
  • Memahami flag umum (-r, -f, -i, -p, -l, -a)
3.2
VOLUME 03 CLI

VIEW, SEARCH & TEXT PROCESSING

Melihat Isi File

BASH
# cat - Concatenate (lihat isi file) cat file.txt ↳ Tampilkan seluruh isi file cat -n file.txt ↳ -n = number lines (tampilkan nomor baris) # less - Pager (scroll file besar) less file.txt ↳ Buka file dengan pager, bisa scroll up/down ↳ Tekan q untuk keluar, / untuk search # more - Pager sederhana more file.txt ↳ Seperti less tapi hanya bisa scroll down # head - Lihat awal file head file.txt ↳ Tampilkan 10 baris pertama (default) head -n 20 file.txt ↳ -n 20 = tampilkan 20 baris pertama # tail - Lihat akhir file tail file.txt ↳ Tampilkan 10 baris terakhir (default) tail -n 20 file.txt ↳ -n 20 = tampilkan 20 baris terakhir tail -f /var/log/syslog ↳ -f = follow, tampilkan baris baru secara real-time ↳ Sangat berguna untuk monitoring log! # wc - Word Count wc file.txt ↳ Hitung baris, kata, karakter wc -l file.txt ↳ -l = lines only wc -w file.txt ↳ -w = words only wc -c file.txt ↳ -c = characters only

Search & Filter

BASH
# grep - Global Regular Expression Print (cari text) grep "error" /var/log/syslog ↳ Cari kata "error" di file syslog grep -i "error" /var/log/syslog ↳ -i = case-insensitive (Error, ERROR, error semua match) grep -r "pattern" /path/to/dir ↳ -r = recursive, cari di semua file dalam directory grep -n "pattern" file.txt ↳ -n = tampilkan nomor baris grep -v "pattern" file.txt ↳ -v = invert match (tampilkan baris yang TIDAK match) grep -c "pattern" file.txt ↳ -c = count (hitung jumlah match) grep -l "pattern" *.txt ↳ -l = files with matches (tampilkan nama file yang match) # find - Cari file berdasarkan kriteria find /home -name "*.txt" ↳ Cari semua file .txt di /home dan subdirectory find / -type f -size +100M ↳ -type f = file saja (bukan directory) ↳ -size +100M = ukuran lebih dari 100MB find /var/log -mtime +7 ↳ -mtime +7 = dimodifikasi lebih dari 7 hari lalu find /tmp -type f -delete ↳ -delete = hapus file yang ditemukan (HATI-HATI!) # locate - Cari file cepat (pakai database) sudo updatedb ↳ Update database locate (perlu dijalankan pertama kali) locate filename.txt ↳ Cari file berdasarkan nama (sangat cepat)

Text Processing

BASH
# sort - Urutkan baris sort file.txt ↳ Urutkan baris secara alfabetis sort -n file.txt ↳ -n = numeric sort (urutkan sebagai angka) sort -r file.txt ↳ -r = reverse (urutkan terbalik) sort -u file.txt ↳ -u = unique (hilangkan duplikat) # uniq - Hilangkan baris duplikat (bersebelahan) sort file.txt | uniq ↳ Sort dulu, baru uniq (uniq butuh input sorted) sort file.txt | uniq -c ↳ -c = count (tampilkan jumlah kemunculan) # cut - Potong kolom cut -d: -f1 /etc/passwd ↳ -d: = delimiter : (pemisah kolom) ↳ -f1 = field 1 (kolom pertama) ↳ Output: daftar username di sistem cut -d: -f1,3 /etc/passwd ↳ -f1,3 = field 1 dan 3 (username dan UID) # awk - Text processing powerful awk '{print $1}' file.txt ↳ Print kolom pertama (default delimiter: whitespace) awk -F: '{print $1, $3}' /etc/passwd ↳ -F: = field separator : ↳ Print kolom 1 dan 3 awk '$3 > 1000 {print $1}' /etc/passwd ↳ Print username dengan UID > 1000 (user biasa) # sed - Stream Editor (replace text) sed 's/old/new/g' file.txt ↳ s = substitute, old = text lama, new = text baru ↳ g = global (ganti semua, bukan hanya yang pertama) sed -i 's/old/new/g' file.txt ↳ -i = in-place (edit file langsung) sed '5d' file.txt ↳ 5d = delete baris ke-5 sed '2,5d' file.txt ↳ 2,5d = delete baris 2 sampai 5
KOMPETENSI SUB-BAB 3.2
  • Mampu melihat isi file dengan cat, less, head, tail
  • Mampu search dengan grep dan find
  • Mampu text processing dengan sort, uniq, cut, awk, sed
3.3
VOLUME 03 CLI

PIPE, REDIRECTION & WILDCARD

Redirection

BASH
# Output redirection (stdout) ls > file.txt ↳ > = redirect output ke file (overwrite) ls >> file.txt ↳ >> = append (tambahkan ke akhir file) # Error redirection (stderr) find / -name "*.conf" 2> errors.txt ↳ 2> = redirect error (stderr) ke file # Redirect stdout dan stderr ke file berbeda command > output.txt 2> errors.txt ↳ stdout ke output.txt, stderr ke errors.txt # Redirect stdout dan stderr ke file yang sama command > all.txt 2>&1 ↳ 2>&1 = redirect stderr ke tempat yang sama dengan stdout command &> all.txt ↳ &> = shortcut untuk > file 2>&1 # Input redirection sort < file.txt ↳ < = redirect input dari file # Here document (multi-line input) cat << EOF Baris 1 Baris 2 Baris 3 EOF ↳ << EOF = mulai here document, akhiri dengan EOF di baris baru

Pipe

BASH
# Pipe (|) - Output command jadi input command berikutnya ls | grep ".txt" ↳ List file, lalu filter hanya yang .txt cat /etc/passwd | grep "root" ↳ Tampilkan isi /etc/passwd, cari baris yang berisi "root" ps aux | grep "nginx" ↳ List process, cari yang nginx ls -l | sort -k5 -n -r ↳ List detail, sort by kolom 5 (size), numeric, reverse cat file.txt | sort | uniq -c | sort -nr ↳ Sort → unik → count → sort by count descending # Tee - Output ke screen DAN file sekaligus ls | tee output.txt ↳ Tampilkan di screen, simpan juga ke file ls | tee -a output.txt ↳ -a = append (tambahkan ke file) # xargs - Execute command dari input find . -name "*.log" | xargs rm ↳ Cari file .log, lalu hapus satu per satu echo "file1 file2 file3" | xargs touch ↳ Buat 3 file sekaligus

Wildcard (Globbing)

BASH
# * - Match zero or more characters ls *.txt ↳ Semua file dengan ekstensi .txt ls file* ↳ Semua file yang diawali "file" # ? - Match exactly one character ls file?.txt ↳ file1.txt, file2.txt, tapi BUKAN file10.txt # [] - Match any character in brackets ls file[1-3].txt ↳ file1.txt, file2.txt, file3.txt ls file[abc].txt ↳ filea.txt, fileb.txt, filec.txt # [!] - Match any character NOT in brackets ls file[!1-3].txt ↳ Semua file.txt KECUALI file1.txt, file2.txt, file3.txt # Contoh penggunaan cp *.jpg /backup/images/ ↳ Copy semua file .jpg ke directory backup rm *.{log,tmp,bak} ↳ Hapus semua file .log, .tmp, .bak (brace expansion) find /var/log -name "*.log" -mtime +30 -delete ↳ Cari & hapus file .log yang lebih dari 30 hari
KOMPETENSI SUB-BAB 3.3
  • Mampu redirect output/error dengan >, >>, 2>
  • Mampu menggunakan pipe (|) untuk chaining command
  • Mampu menggunakan wildcard (*, ?, [])
VOLUME 04 / 17

FILE SYSTEM & STORAGE MANAGEMENT

Filesystem Hierarchy Standard (FHS), mount/unmount, fstab, disk partitioning, LVM (Logical Volume Manager), dan manajemen storage tingkat lanjut.
SUB-BAB4 LEVELStorage WAKTU70 MENIT
4.1
VOLUME 04 STORAGE

FILESYSTEM HIERARCHY STANDARD (FHS)

Struktur Direktori Linux

FHS (Filesystem Hierarchy Standard) adalah standar struktur direktori di Linux. Semua distro mengikuti standar ini agar konsisten.

DIRECTORYFUNGSICONTOH ISI
/Root directory (puncak hierarki)Semua directory lain ada di sini
/binBinary esensial (user commands)ls, cp, mv, bash
/sbinBinary esensial (system admin)fdisk, iptables, reboot
/etcConfiguration files/etc/passwd, /etc/fstab, /etc/hosts
/homeHome directory user biasa/home/admin, /home/user1
/rootHome directory rootKhusus root user
/varVariable data (berubah-ubah)/var/log, /var/www, /var/spool
/tmpTemporary files (dihapus saat reboot)File sementara aplikasi
/usrUser programs & data/usr/bin, /usr/lib, /usr/share
/optOptional/third-party softwareSoftware tambahan (contoh: /opt/google)
/devDevice files/dev/sda, /dev/tty, /dev/null
/procVirtual filesystem (process info)/proc/cpuinfo, /proc/meminfo
/sysVirtual filesystem (hardware info)/sys/class, /sys/block
/bootBoot loader filesvmlinuz, initrd, grub
/libShared librariesLibrary untuk /bin dan /sbin
/mntMount point temporaryMount manual filesystem
/mediaMount point removable mediaUSB, CD-ROM auto-mount
/srvService data/srv/ftp, /srv/www
PENTING: Jangan asal hapus file di /bin, /sbin, /lib, /etc! File-file ini esensial untuk sistem. Selalu backup sebelum modifikasi.
KOMPETENSI SUB-BAB 4.1
  • Memahami struktur direktori Linux (FHS)
  • Tahu fungsi setiap directory utama
  • Mampu navigasi file system dengan percaya diri
4.2
VOLUME 04 STORAGE

MOUNT & FSTAB

Konsep Mount

Mount adalah proses mengaitkan filesystem (partisi) ke directory tertentu di file system tree. Di Linux, semua storage diakses melalui directory (mount point).

BASH
# Lihat filesystem yang sedang mounted df -h ↳ -h = human-readable (GB, MB) # Filesystem Size Used Avail Use% Mounted on # /dev/sda1 20G 5.2G 14G 28% / # /dev/sda2 50G 12G 35G 26% /home lsblk ↳ List block devices (disk, partisi, mount point) # NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT # sda 8:0 0 50G 0 disk # ├─sda1 8:1 0 20G 0 part / # └─sda2 8:2 0 30G 0 part /home mount ↳ Tampilkan semua mount dengan detail findmnt ↳ Tree view mount points (lebih rapi) # Mount manual filesystem sudo mount /dev/sdb1 /mnt ↳ Mount partisi /dev/sdb1 ke directory /mnt sudo mount -t ext4 /dev/sdb1 /mnt ↳ -t ext4 = specify filesystem type sudo mount -o ro /dev/sdb1 /mnt ↳ -o ro = read-only sudo mount -o rw /dev/sdb1 /mnt ↳ -o rw = read-write (default) # Unmount filesystem sudo umount /mnt ↳ Unmount dari mount point sudo umount /dev/sdb1 ↳ Unmount dari device # Cek penggunaan disk du -sh /var/log ↳ -s = summary, -h = human-readable ↳ Lihat total ukuran /var/log du -sh /* ↳ Lihat ukuran setiap directory di root du -h --max-depth=1 /home ↳ Lihat ukuran subdirectory di /home (depth 1)

/etc/fstab

/etc/fstab (filesystem table) adalah file konfigurasi yang mendefinisikan filesystem yang harus di-mount saat boot. Format:

# device mountpoint fstype options dump pass
BASH
# Lihat isi /etc/fstab cat /etc/fstab # /etc/fstab: static file system information # # UUID=xxxx-xxxx / ext4 errors=remount-ro 0 1 # UUID=yyyy-yyyy /home ext4 defaults 0 2 # UUID=zzzz-zzzz none swap sw 0 0 # Penjelasan kolom: # 1. Device/UUID : Partisi yang di-mount # 2. Mount point : Directory tujuan mount # 3. Filesystem type: ext4, xfs, swap, dll # 4. Options : defaults, ro, noexec, dll # 5. Dump : 0 = tidak di-backup, 1 = di-backup # 6. Pass : 0 = tidak dicek, 1 = root fs, 2 = lainnya # Lihat UUID semua partisi blkid ↳ Tampilkan UUID dan type semua partisi # /dev/sda1: UUID="xxxx-xxxx" TYPE="ext4" # /dev/sda2: UUID="yyyy-yyyy" TYPE="ext4" # Edit /etc/fstab (HATI-HATI! Salah edit = sistem tidak boot) sudo cp /etc/fstab /etc/fstab.backup ↳ Backup dulu sebelum edit! sudo nano /etc/fstab ↳ Edit dengan nano # Test fstab tanpa reboot sudo mount -a ↳ -a = mount all dari fstab ↳ Jika ada error, perbaiki sebelum reboot! # Contoh menambah entry ke fstab # Mount /dev/sdb1 ke /data dengan ext4 UUID=abcd-1234 /data ext4 defaults 0 2 # Mount dengan opsi khusus UUID=abcd-1234 /data ext4 defaults,noatime,nodiratime 0 2 ↳ noatime = tidak update access time (performa) ↳ nodiratime = tidak update directory access time
PERINGATAN: Salah edit /etc/fstab bisa membuat sistem TIDAK BISA BOOT. Selalu backup fstab sebelum edit, dan test dengan mount -a sebelum reboot.
KOMPETENSI SUB-BAB 4.2
  • Memahami konsep mount dan mount point
  • Mampu mount/unmount filesystem manual
  • Mampu edit /etc/fstab dengan aman
  • Mampu cek penggunaan disk dengan df dan du
4.3
VOLUME 04 STORAGE

DISK PARTITIONING & FORMAT

Partisi Disk

BASH
# Lihat informasi disk lsblk ↳ List block devices sudo fdisk -l ↳ List semua disk dan partisi dengan detail sudo parted -l ↳ List partisi dengan parted (support GPT) # Partisi disk dengan fdisk (MBR) sudo fdisk /dev/sdb ↳ Buka fdisk untuk disk /dev/sdb # Command di dalam fdisk: # m = help (lihat semua command) # p = print partition table # n = new partition # d = delete partition # t = change partition type # w = write changes to disk # q = quit without saving # Partisi disk dengan parted (GPT) sudo parted /dev/sdb # Command di dalam parted: # print = lihat partisi # mklabel gpt = buat GPT partition table # mkpart primary ext4 0% 50% = buat partisi 50% disk # quit = keluar # Format partisi dengan filesystem sudo mkfs.ext4 /dev/sdb1 ↳ Format partisi dengan ext4 sudo mkfs.xfs /dev/sdb1 ↳ Format dengan XFS (performa tinggi) sudo mkfs.vfat /dev/sdb1 ↳ Format dengan FAT32 (kompatibel Windows) sudo mkswap /dev/sdb2 ↳ Format sebagai swap # Label partisi sudo e2label /dev/sdb1 data ↳ Beri label "data" ke partisi ext4 sudo e2label /dev/sdb1 ↳ Lihat label partisi

Jenis Filesystem

FILESYSTEMKELEBIHANKEKURANGANUSE CASE
ext4Stabil, mature, kompatibelTidak ada snapshotDefault Linux, general purpose
XFSPerforma tinggi, scalableTidak bisa shrinkLarge files, server
BtrfsSnapshot, checksum, RAIDMasih berkembangAdvanced features
ZFSEnterprise-grade, snapshotRAM intensiveEnterprise, NAS
FAT32Kompatibel semua OSMax file 4GBUSB, compatibility
NTFSWindows compatibleLinux read/write terbatasDual boot Windows
swapVirtual memory-RAM overflow
KOMPETENSI SUB-BAB 4.3
  • Mampu partisi disk dengan fdisk/parted
  • Mampu format partisi dengan berbagai filesystem
  • Memahami perbedaan ext4, XFS, Btrfs
4.4
VOLUME 04 STORAGE

LVM (LOGICAL VOLUME MANAGER)

Konsep LVM

LVM adalah sistem manajemen storage yang memberikan fleksibilitas tinggi. Dengan LVM, kamu bisa:

RESIZE DYNAMIC
Ubah ukuran volume tanpa downtime
SNAPSHOT
Buat snapshot untuk backup
STRIPING
Gabung multiple disk untuk performa
MIRRORING
Redundansi data (RAID 1-like)

Arsitektur LVM

KOMPONENDESKRIPSIANALOGI
Physical Volume (PV)Disk/partisi fisik yang digunakan LVMBahan baku
Volume Group (VG)Pool storage dari gabungan PVGudang penyimpanan
Logical Volume (LV)"Partisi virtual" dari VGRak di gudang
BASH
# Install LVM tools sudo apt install lvm2 # 1. Buat Physical Volume sudo pvcreate /dev/sdb1 /dev/sdc1 ↳ Inisialisasi partisi sebagai PV sudo pvs ↳ List Physical Volumes sudo pvdisplay ↳ Detail Physical Volumes # 2. Buat Volume Group sudo vgcreate myvg /dev/sdb1 /dev/sdc1 ↳ Buat VG "myvg" dari 2 PV sudo vgs ↳ List Volume Groups sudo vgdisplay ↳ Detail Volume Groups # 3. Buat Logical Volume sudo lvcreate -L 10G -n data myvg ↳ -L 10G = size 10GB ↳ -n data = nama LV "data" ↳ myvg = nama VG sudo lvcreate -l 100%FREE -n backup myvg ↳ -l 100%FREE = gunakan semua space tersisa sudo lvs ↳ List Logical Volumes sudo lvdisplay ↳ Detail Logical Volumes # 4. Format LV dengan filesystem sudo mkfs.ext4 /dev/myvg/data # 5. Mount LV sudo mkdir /data sudo mount /dev/myvg/data /data # 6. Tambah ke /etc/fstab /dev/myvg/data /data ext4 defaults 0 2 # Resize Logical Volume sudo lvextend -L +5G /dev/myvg/data ↳ Tambah 5GB ke LV sudo resize2fs /dev/myvg/data ↳ Resize filesystem ext4 (harus setelah lvextend) sudo lvextend -l +100%FREE /dev/myvg/data ↳ Gunakan semua free space di VG # Remove LVM sudo umount /data sudo lvremove /dev/myvg/data sudo vgremove myvg sudo pvremove /dev/sdb1 /dev/sdc1
KOMPETENSI SUB-BAB 4.4
  • Memahami konsep LVM (PV, VG, LV)
  • Mampu setup LVM dari awal
  • Mampu resize Logical Volume
VOLUME 05 / 17

USER, GROUP & PERMISSIONS

User management, group management, file permissions (chmod, chown), ACL (Access Control Lists), dan sudo. Fondasi keamanan Linux.
SUB-BAB4 LEVELAccess WAKTU60 MENIT
5.1
VOLUME 05 ACCESS

USER MANAGEMENT

Manajemen User

BASH
# Lihat user yang sedang login whoami ↳ Tampilkan username saat ini who ↳ Lihat siapa saja yang login w ↳ Lihat siapa login dan apa yang mereka lakukan last ↳ Lihat history login # Lihat daftar user cat /etc/passwd ↳ File berisi info semua user ↳ Format: username:password:UID:GID:comment:home:shell cut -d: -f1 /etc/passwd ↳ Tampilkan hanya username # Tambah user baru sudo useradd newuser ↳ Buat user baru (tanpa home directory) sudo useradd -m newuser ↳ -m = create home directory (/home/newuser) sudo useradd -m -s /bin/bash newuser ↳ -s /bin/bash = set default shell sudo useradd -m -G sudo,developers newuser ↳ -G = tambahkan ke group tambahan # Set password user sudo passwd newuser ↳ Set/change password untuk user # Modifikasi user sudo usermod -aG sudo newuser ↳ -aG = append to group (tambah ke group tanpa hapus dari group lain) sudo usermod -s /bin/zsh newuser ↳ -s = change shell sudo usermod -L newuser ↳ -L = lock account (tidak bisa login) sudo usermod -U newuser ↳ -U = unlock account sudo usermod -e 2026-12-31 newuser ↳ -e = set expiration date # Hapus user sudo userdel newuser ↳ Hapus user (home directory tetap ada) sudo userdel -r newuser ↳ -r = remove home directory juga # Ganti user (switch user) su newuser ↳ Switch ke user newuser su - newuser ↳ - = load environment user baru (recommended) # Lihat info user id newuser ↳ Lihat UID, GID, dan groups user finger newuser ↳ Lihat detail info user (jika finger terinstall)
KOMPETENSI SUB-BAB 5.1
  • Mampu menambah, modifikasi, dan hapus user
  • Mampu set password dan lock/unlock account
  • Memahami struktur /etc/passwd
5.2
VOLUME 05 ACCESS

GROUP MANAGEMENT

Manajemen Group

BASH
# Lihat daftar group cat /etc/group ↳ File berisi info semua group ↳ Format: groupname:password:GID:members groups ↳ Lihat group user saat ini groups newuser ↳ Lihat group untuk user tertentu # Tambah group baru sudo groupadd developers ↳ Buat group baru sudo groupadd -g 1500 developers ↳ -g = specify GID # Tambah user ke group sudo usermod -aG developers newuser ↳ -aG = append to group (tambah tanpa hapus dari group lain) sudo gpasswd -a newuser developers ↳ Cara alternatif tambah user ke group # Hapus user dari group sudo gpasswd -d newuser developers ↳ -d = delete from group # Set primary group user sudo usermod -g developers newuser ↳ -g = set primary group (lowercase g) # Hapus group sudo groupdel developers ↳ Hapus group (tidak bisa hapus primary group user) # Ganti nama group sudo groupmod -n newname oldname ↳ -n = new name # Lihat anggota group getent group developers ↳ Lihat detail group termasuk anggota members developers ↳ List anggota group (jika members terinstall) # Group penting di Debian # root : UID 0, superuser # sudo : user di group ini bisa pakai sudo # adm : bisa baca log di /var/log # www-data : user untuk web server (Apache/Nginx) # ssh : user untuk SSH server # docker : bisa jalankan docker tanpa sudo
KOMPETENSI SUB-BAB 5.2
  • Mampu menambah, modifikasi, dan hapus group
  • Mampu tambah/hapus user dari group
  • Memahami group-group penting di Debian
5.3
VOLUME 05 ACCESS

FILE PERMISSIONS (CHMOD, CHOWN)

Memahami Permission

Setiap file/directory di Linux memiliki owner (pemilik), group, dan permissions (hak akses). Permission terdiri dari 3 kategori:

PERMISSIONANGKAFILEDIRECTORY
r (read)4Baca isi fileList isi directory (ls)
w (write)2Modifikasi fileTambah/hapus file di directory
x (execute)1Jalankan file sebagai programMasuk ke directory (cd)

Permission diterapkan ke 3 kategori user:

KATEGORISIMBOLARTI
User (owner)uPemilik file
GroupgGroup pemilik file
OtheroSemua orang lain

Membaca Permission

BASH
# Lihat permission ls -l file.txt # -rw-r--r-- 1 admin admin 1234 Jan 15 10:30 file.txt # Penjelasan: # - = file type (- = file, d = directory, l = symlink) # rw- = owner permission (read, write, no execute) # r-- = group permission (read only) # r-- = other permission (read only) # 1 = number of hard links # admin = owner # admin = group # 1234 = size in bytes # Jan 15 10:30 = modification time # file.txt = filename # Contoh lain: # drwxr-xr-x 2 root root 4096 Jan 15 10:30 /etc # d = directory # rwx = owner (root) punya full access # r-x = group (root) bisa read & execute, tidak write # r-x = other bisa read & execute, tidak write # -rwxr-xr-x 1 admin admin 1234 Jan 15 10:30 script.sh # File executable (script) # Owner bisa read, write, execute # Group & other bisa read & execute

Mengubah Permission (chmod)

BASH
# chmod - Change Mode (ubah permission) # Metode 1: Numeric (octal) chmod 755 file.txt ↳ 7 = rwx (owner), 5 = r-x (group), 5 = r-x (other) ↳ 7 = 4+2+1, 5 = 4+1, 4 = 4 chmod 644 file.txt ↳ 6 = rw- (owner), 4 = r-- (group), 4 = r-- (other) chmod 700 script.sh ↳ 7 = rwx (owner), 0 = --- (group), 0 = --- (other) ↳ Hanya owner yang bisa akses chmod 600 secret.txt ↳ 6 = rw- (owner), 0 = --- (group), 0 = --- (other) ↳ Hanya owner bisa read/write # Metode 2: Symbolic chmod u+x file.txt ↳ u = user (owner), +x = tambah execute chmod g-w file.txt ↳ g = group, -w = hapus write chmod o=r file.txt ↳ o = other, =r = set read only chmod a+x script.sh ↳ a = all (u+g+o), +x = tambah execute untuk semua chmod u=rwx,g=rx,o=r file.txt ↳ Set sekaligus: owner=rwx, group=rx, other=r # Recursive (untuk directory) chmod -R 755 /path/to/directory ↳ -R = recursive, terapkan ke semua file & subdirectory # Permission umum: # 644 = rw-r--r-- (file biasa) # 755 = rwxr-xr-x (directory, executable) # 600 = rw------- (file privat) # 700 = rwx------ (directory privat) # 640 = rw-r----- (file group-restricted) # 775 = rwxrwxr-x (collaborative directory)

Mengubah Owner & Group (chown)

BASH
# chown - Change Owner sudo chown newuser file.txt ↳ Ubah owner file menjadi newuser sudo chown newuser:newgroup file.txt ↳ Ubah owner DAN group sekaligus sudo chown :newgroup file.txt ↳ Ubah group saja (owner tetap) sudo chown -R newuser:newgroup /path/to/directory ↳ -R = recursive, terapkan ke semua isi directory # chgrp - Change Group sudo chgrp newgroup file.txt ↳ Ubah group file sudo chgrp -R newgroup /path/to/directory ↳ Recursive # Contoh penggunaan sudo chown www-data:www-data /var/www/html ↳ Set ownership untuk web server sudo chmod -R 755 /var/www/html ↳ Set permission untuk web directory
KOMPETENSI SUB-BAB 5.3
  • Memahami sistem permission Linux (rwx)
  • Mampu gunakan chmod (numeric & symbolic)
  • Mampu gunakan chown dan chgrp
  • Tahu permission umum untuk file & directory
VOLUME 06 / 17

APT & PACKAGE MANAGEMENT

Package management dengan APT (Advanced Package Tool). Install, remove, update, upgrade, repository management, dan troubleshooting package.
SUB-BAB3 LEVELPackage WAKTU50 MENIT
6.1
VOLUME 06 PACKAGE

APT COMMANDS

BASH
# Update package list (dari repository) sudo apt update ↳ Download daftar package terbaru dari repository ↳ WAJIB dijalankan sebelum install/upgrade # Upgrade semua package sudo apt upgrade -y ↳ Upgrade semua package ke versi terbaru ↳ -y = auto-yes, tidak tanya konfirmasi # Dist-upgrade (smart upgrade) sudo apt dist-upgrade -y ↳ Upgrade dengan dependency handling cerdas ↳ Bisa install/remove package jika perlu # Install package sudo apt install nginx ↳ Install package nginx sudo apt install nginx php mysql-server ↳ Install multiple package sekaligus sudo apt install -y nginx ↳ -y = auto-yes # Remove package sudo apt remove nginx ↳ Remove package (config files tetap ada) sudo apt purge nginx ↳ Remove package + config files sudo apt autoremove ↳ Hapus package yang tidak lagi dibutuhkan (dependency) # Search package apt search nginx ↳ Cari package dengan kata kunci "nginx" # Info package apt show nginx ↳ Tampilkan detail info package # List installed packages apt list --installed ↳ List semua package yang terinstall dpkg --list ↳ Cara alternatif list package # Check package status dpkg -s nginx ↳ Status package nginx # List files in package dpkg -L nginx ↳ List semua file yang diinstall oleh package nginx # Find which package owns a file dpkg -S /etc/nginx/nginx.conf ↳ Cari package yang memiliki file tersebut # Clean cache sudo apt clean ↳ Hapus semua cached .deb files sudo apt autoclean ↳ Hapus cached .deb files yang obsolete # Fix broken packages sudo apt --fix-broken install ↳ Perbaiki dependency yang rusak sudo dpkg --configure -a ↳ Configure package yang belum terkonfigurasi
KOMPETENSI SUB-BAB 6.1
  • Mampu update, upgrade, install, remove package
  • Mampu search dan info package
  • Mampu troubleshoot broken packages
VOLUME 07 / 17

DEBIAN NETWORKING FUNDAMENTALS

Network interfaces, IP configuration, routing, DNS, netplan, ip command, dan network troubleshooting di Debian.
SUB-BAB3 LEVELNetwork WAKTU60 MENIT
7.1
VOLUME 07 NETWORK

IP CONFIGURATION & INTERFACES

BASH
# Lihat network interfaces ip link show ↳ Tampilkan semua network interfaces ip addr show ↳ Tampilkan IP address semua interfaces ip a ↳ Shortcut untuk ip addr show ifconfig ↳ Cara lama (legacy, perlu net-tools) # Lihat IP address interface tertentu ip addr show eth0 ↳ IP address interface eth0 # Set IP address manual sudo ip addr add 192.168.1.100/24 dev eth0 ↳ Set IP 192.168.1.100 dengan subnet /24 ke eth0 sudo ip addr del 192.168.1.100/24 dev eth0 ↳ Hapus IP address dari interface # Enable/disable interface sudo ip link set eth0 up ↳ Activate interface sudo ip link set eth0 down ↳ Deactivate interface # Lihat routing table ip route show ↳ Tampilkan routing table ip r ↳ Shortcut # Add default gateway sudo ip route add default via 192.168.1.1 ↳ Set default gateway ke 192.168.1.1 # Add static route sudo ip route add 10.0.0.0/8 via 192.168.1.254 ↳ Route ke network 10.0.0.0/8 via gateway 192.168.1.254 # Delete route sudo ip route del 10.0.0.0/8 # Lihat DNS configuration cat /etc/resolv.conf ↳ File berisi DNS server yang digunakan # Test konektivitas ping 8.8.8.8 ↳ Test koneksi ke Google DNS ping -c 4 google.com ↳ -c 4 = kirim 4 packet saja traceroute google.com ↳ Lihat route ke tujuan mtr google.com ↳ Kombinasi ping + traceroute (real-time) # Lihat listening ports sudo ss -tulpn ↳ -t = TCP, -u = UDP, -l = listening, -p = program, -n = numeric sudo netstat -tulpn ↳ Cara lama (legacy)
KOMPETENSI SUB-BAB 7.1
  • Mampu konfigurasi IP address manual
  • Mampu set default gateway dan static route
  • Mampu test konektivitas dengan ping, traceroute
VOLUME 08 / 17

SSH & REMOTE ADMINISTRATION

SSH server & client configuration, key-based authentication, SSH config file, port forwarding, dan secure remote administration.
SUB-BAB3 LEVELRemote WAKTU50 MENIT
8.1
VOLUME 08 SSH

SSH SERVER CONFIGURATION

BASH
# Install SSH server sudo apt install openssh-server # Cek status SSH service sudo systemctl status ssh ↳ Lihat status SSH service # Enable SSH start on boot sudo systemctl enable ssh # Start/restart SSH sudo systemctl start ssh sudo systemctl restart ssh # Edit SSH configuration sudo nano /etc/ssh/sshd_config # Konfigurasi penting: Port 2222 ↳ Ubah port SSH (default 22) untuk security PermitRootLogin no ↳ Disable root login (security) PasswordAuthentication no ↳ Disable password auth (pakai key saja) PubkeyAuthentication yes ↳ Enable key-based authentication AllowUsers admin deploy ↳ Hanya user tertentu yang bisa SSH AllowGroups sshusers ↳ Hanya group tertentu yang bisa SSH MaxAuthTries 3 ↳ Max percobaan login sebelum disconnect ClientAliveInterval 300 ↳ Keep-alive interval (detik) ClientAliveCountMax 2 ↳ Max missed keep-alive sebelum disconnect # Restart SSH setelah edit config sudo systemctl restart ssh # Allow SSH di firewall sudo ufw allow 2222/tcp ↳ Allow port 2222 (custom SSH port)
KOMPETENSI SUB-BAB 8.1
  • Mampu install dan konfigurasi SSH server
  • Mampu hardening SSH (disable root, change port)
  • Memahami konfigurasi sshd_config
VOLUME 09 / 17

PROCESS, SERVICE & SYSTEMD

Process management, systemd service, unit files, systemctl commands, dan service administration.
SUB-BAB3LEVELServiceWAKTU50 MENIT
9.1
VOLUME 09 SERVICE

SYSTEMD & SYSTEMCTL

BASH
# systemctl - Kontrol systemd # Start service sudo systemctl start nginx ↳ Start service nginx # Stop service sudo systemctl stop nginx # Restart service sudo systemctl restart nginx # Reload configuration (tanpa restart) sudo systemctl reload nginx # Enable service (start on boot) sudo systemctl enable nginx # Disable service (tidak start on boot) sudo systemctl disable nginx # Status service systemctl status nginx ↳ Lihat status, PID, memory, logs # List all services systemctl list-units --type=service # List failed services systemctl --failed # Process management ps aux ↳ List semua process ps aux | grep nginx ↳ Cari process nginx top ↳ Real-time process monitor (interactive) htop ↳ Enhanced top (lebih user-friendly) kill 1234 ↳ Kill process dengan PID 1234 killall nginx ↳ Kill semua process bernama nginx pkill -f nginx ↳ Kill process yang match pattern
KOMPETENSI SUB-BAB 9.1
  • Mampu start/stop/restart/enable/disable service
  • Mampu cek status service
  • Mampu manage process dengan ps, kill, top
VOLUME 10 / 17

SYSTEM MONITORING & LOGS

System monitoring dengan top, htop, journalctl, log rotation, dan performance analysis.
SUB-BAB2LEVELMonitorWAKTU40 MENIT
10.1
VOLUME 10 MONITOR

MONITORING & LOGS

BASH
# journalctl - System logs journalctl ↳ Lihat semua logs journalctl -u nginx ↳ -u = unit, logs untuk service nginx journalctl -f ↳ -f = follow, real-time logs journalctl --since "1 hour ago" ↳ Logs dari 1 jam terakhir journalctl -p err ↳ -p = priority, hanya error # System info uname -a ↳ Kernel & system info lsb_release -a ↳ Debian version info uptime ↳ System uptime & load average free -h ↳ Memory usage df -h ↳ Disk usage # Performance monitoring vmstat 1 ↳ Virtual memory stats, update setiap 1 detik iostat 1 ↳ I/O statistics sar -u 1 ↳ CPU usage (perlu sysstat)
KOMPETENSI SUB-BAB 10.1
  • Mampu baca system logs dengan journalctl
  • Mampu monitor performance dengan top, vmstat, iostat
VOLUME 11 / 17

WEB SERVER FUNDAMENTALS

Apache, Nginx, virtual hosts, SSL/TLS, PHP-FPM, dan web server configuration.
SUB-BAB3LEVELWebWAKTU60 MENIT
11.1
VOLUME 11 WEB

NGINX & APACHE

BASH
# Install Nginx sudo apt install nginx # Nginx commands sudo systemctl start nginx sudo systemctl enable nginx sudo nginx -t ↳ Test configuration sudo nginx -s reload ↳ Reload configuration # Nginx config files # /etc/nginx/nginx.conf - Main config # /etc/nginx/sites-available/ - Available sites # /etc/nginx/sites-enabled/ - Enabled sites (symlinks) # Install Apache sudo apt install apache2 # Apache commands sudo systemctl start apache2 sudo apache2ctl configtest ↳ Test configuration # Apache config files # /etc/apache2/apache2.conf - Main config # /etc/apache2/sites-available/ - Available sites # /etc/apache2/sites-enabled/ - Enabled sites # Install PHP + PHP-FPM sudo apt install php php-fpm php-mysql # Test PHP php -v ↳ Check PHP version
KOMPETENSI SUB-BAB 11.1
  • Mampu install dan konfigurasi Nginx/Apache
  • Mampu setup virtual hosts
  • Mampu install PHP dan PHP-FPM
VOLUME 12 / 17

DATABASE SERVER FUNDAMENTALS

MariaDB, PostgreSQL, backup, replication, dan database administration.
SUB-BAB2LEVELDatabaseWAKTU50 MENIT
12.1
VOLUME 12 DATABASE

MARIADB & POSTGRESQL

BASH
# Install MariaDB sudo apt install mariadb-server mariadb-client # Secure MariaDB sudo mysql_secure_installation ↳ Setup root password, remove anonymous users, dll # Login to MariaDB sudo mysql -u root -p # Basic SQL commands CREATE DATABASE mydb; CREATE USER 'user'@'localhost' IDENTIFIED BY 'password'; GRANT ALL ON mydb.* TO 'user'@'localhost'; FLUSH PRIVILEGES; EXIT; # Install PostgreSQL sudo apt install postgresql postgresql-client # Login to PostgreSQL sudo -u postgres psql # Basic SQL commands CREATE DATABASE mydb; CREATE USER myuser WITH PASSWORD 'password'; GRANT ALL PRIVILEGES ON DATABASE mydb TO myuser;
KOMPETENSI SUB-BAB 12.1
  • Mampu install dan secure MariaDB/PostgreSQL
  • Mampu buat database dan user
VOLUME 13 / 17

DNS & DHCP SERVER

BIND9, dnsmasq, isc-dhcp-server, dan network services configuration.
SUB-BAB2LEVELInfraWAKTU50 MENIT
13.1
VOLUME 13 INFRA

BIND9 & DHCP

BASH
# Install BIND9 (DNS server) sudo apt install bind9 bind9utils bind9-doc # Config files # /etc/bind/named.conf.options - Global options # /etc/bind/named.conf.local - Local zones # /var/cache/bind/ - Zone files # Test configuration sudo named-checkconf sudo named-checkzone example.com /var/cache/bind/db.example.com # Install DHCP server sudo apt install isc-dhcp-server # Config file # /etc/dhcp/dhcpd.conf # Example DHCP config subnet 192.168.1.0 netmask 255.255.255.0 { range 192.168.1.100 192.168.1.200; option routers 192.168.1.1; option domain-name-servers 8.8.8.8, 8.8.4.4; }
KOMPETENSI SUB-BAB 13.1
  • Mampu install dan konfigurasi BIND9
  • Mampu install dan konfigurasi DHCP server
VOLUME 14 / 17

FILE SHARING SERVER

Samba (SMB/CIFS), NFS, dan file sharing configuration untuk multi-platform.
SUB-BAB2LEVELShareWAKTU45 MENIT
14.1
VOLUME 14 SHARE

SAMBA & NFS

BASH
# Install Samba sudo apt install samba samba-common-bin # Config file # /etc/samba/smb.conf # Example share [shared] path = /srv/samba/shared browseable = yes read only = no guest ok = no valid users = @sambashare # Add Samba user sudo smbpasswd -a username # Test config testparm # Install NFS sudo apt install nfs-kernel-server # Config file # /etc/exports # Example export /srv/nfs/shared 192.168.1.0/24(rw,sync,no_subtree_check) # Apply changes sudo exportfs -a sudo systemctl restart nfs-kernel-server
KOMPETENSI SUB-BAB 14.1
  • Mampu install dan konfigurasi Samba
  • Mampu install dan konfigurasi NFS
VOLUME 15 / 17

DEBIAN SERVER SECURITY

UFW, fail2ban, AppArmor, server hardening, dan security best practices.
SUB-BAB3LEVELSecurityWAKTU60 MENIT
15.1
VOLUME 15 SECURITY

UFW & FAIL2BAN

BASH
# Install UFW sudo apt install ufw # Basic UFW commands sudo ufw default deny incoming sudo ufw default allow outgoing sudo ufw allow ssh sudo ufw allow 80/tcp sudo ufw allow 443/tcp sudo ufw enable sudo ufw status # Install fail2ban sudo apt install fail2ban # Config file # /etc/fail2ban/jail.local # Example jail [sshd] enabled = true port = ssh filter = sshd logpath = /var/log/auth.log maxretry = 3 sudo systemctl restart fail2ban sudo fail2ban-client status
KOMPETENSI SUB-BAB 15.1
  • Mampu konfigurasi UFW firewall
  • Mampu install dan konfigurasi fail2ban
VOLUME 16 / 17

BACKUP & RECOVERY

rsync, tar, borg, timeshift, dan disaster recovery strategies.
SUB-BAB2LEVELBackupWAKTU45 MENIT
16.1
VOLUME 16 BACKUP

RSYNC & TAR

BASH
# rsync - Sync files rsync -av /source/ /destination/ ↳ -a = archive mode, -v = verbose rsync -avz /source/ user@remote:/destination/ ↳ -z = compress, sync ke remote server rsync -av --delete /source/ /destination/ ↳ --delete = hapus file di destination yang tidak ada di source # tar - Archive files tar -czf archive.tar.gz /path/to/backup ↳ -c = create, -z = gzip, -f = file tar -xzf archive.tar.gz ↳ -x = extract tar -cjf archive.tar.bz2 /path/to/backup ↳ -j = bzip2 compression # Backup script example #!/bin/bash BACKUP_DIR="/backup" DATE=$(date +%Y%m%d) tar -czf $BACKUP_DIR/backup-$DATE.tar.gz /var/www /etc find $BACKUP_DIR -name "*.tar.gz" -mtime +30 -delete
KOMPETENSI SUB-BAB 16.1
  • Mampu backup dengan rsync dan tar
  • Mampu buat backup script otomatis
VOLUME 17 / 17

TROUBLESHOOTING DEBIAN SERVER

Diagnostic tools, common issues, recovery procedures, dan best practices untuk maintain server.
SUB-BAB3LEVELDiagnosticWAKTU60 MENIT
17.1
VOLUME 17 TROUBLESHOOT

COMMON ISSUES & SOLUTIONS

MASALAHGEJALASOLUSI
Server tidak boot Stuck di boot process Boot ke recovery mode, cek /etc/fstab, fsck filesystem
Cannot login Password ditolak Boot single-user mode, reset password dengan passwd
Service tidak start systemctl status menunjukkan failed Cek journalctl -u service, perbaiki config
Disk full No space left on device df -h, hapus file besar, clean apt cache
Network down Tidak bisa ping gateway Cek ip link, ip addr, routing table, DNS
High CPU/Memory Server lambat top/htop, identifikasi process, kill atau optimize
BASH
# Diagnostic commands dmesg | tail ↳ Kernel messages (hardware issues) journalctl -p err --since "1 hour ago" ↳ Error logs dari 1 jam terakhir sudo fsck /dev/sda1 ↳ Check & repair filesystem (unmount dulu!) # Recovery mode # 1. Reboot, tekan Shift/Esc saat GRUB # 2. Pilih "Advanced options" → "Recovery mode" # 3. Pilih "root" untuk root shell # 4. Remount filesystem read-write: mount -o remount,rw / # Reset root password passwd root # Fix fstab nano /etc/fstab # Reboot reboot
KOMPETENSI SUB-BAB 17.1
  • Mampu diagnose common server issues
  • Mampu boot ke recovery mode
  • Mampu reset password dan fix fstab
SERI LENGKAP SELESAI

SELAMAT!

Kamu telah menyelesaikan 17 volume seri Debian Server Essentials. Dari fundamental Linux hingga server administration, troubleshooting, dan recovery. Kamu sekarang memiliki fondasi yang kuat untuk menjadi Debian/Linux system administrator profesional. Terus belajar, terus praktik, dan jangan takut eksperimen!
VOLUME17 LEVELESSENTIALS NEXTAdvanced Topics
ABDURROZAK.MY.ID // TERHUBUNG

JARINGAN SOSIAL

Temukan saya di berbagai platform digital