ABDURROZAK.MY.ID // DEBIAN LINUX SERVER FUNDAMENTAL
INSTALASI DEBIAN SERVERDARI NOL SAMPAI JADI
Volume 02 dari seri Debian Linux Server Fundamental. Panduan step-by-step install Debian Server dari bootable media hingga sistem siap pakai. Setiap tahap installer dijelaskan detail dengan screenshot mockup, penjelasan parameter, dan tips troubleshooting. Termasuk partisi disk, konfigurasi network, user management, repository, dan instalasi SSH Server.
VOLUME02 / 17
SUB-BAB15
BACA120 MENIT
OSDebian 12
ABDUR ROZAK, S.Kom.
Web Developer & System Administrator - abdurrozak.my.id
VOLUME 02 / 17
INSTAL DEBIAN SERVER DARI NOL
Panduan lengkap instalasi Debian Server step-by-step. Dari persiapan hardware, boot dari media, konfigurasi installer, partisi disk (guided & manual), setup user & password, pemilihan software, instalasi GRUB, first boot, konfigurasi repository, update sistem, hingga instalasi SSH Server. Setiap langkah dijelaskan detail dengan penjelasan command dan parameter.
SUB-BAB15LEVELInstallationWAKTU120 MENIT
01
SUB-BAB 01 PREPARATION
PERSIAPAN INSTALASI
Checklist Persiapan
Sebelum mulai instalasi, pastikan semua persiapan berikut sudah selesai:
ISO netinst Debian 12 sudah didownload & checksum verified
BOOTABLE MEDIA
USB bootable atau ISO mounted di VM
BACKUP DATA
Data penting di-backup (jika install di physical server)
INFO NETWORK
Catat IP, gateway, DNS (untuk static IP)
CATATAN KONFIGURASI
Siapkan catatan: hostname, domain, user, password
Spesifikasi Minimum vs Recommended
KOMPONEN
MINIMUM
RECOMMENDED
UNTUK
CPU
1 GHz
2+ cores, 2+ GHz
Server production
RAM
512 MB
2+ GB
Web server, database
Storage
2 GB
20+ GB SSD
Server dengan data
Network
1 NIC
2+ NIC (redundancy)
High availability
Template Catatan Instalasi
TEMPLATE
# Catat informasi berikut sebelum instalasi:Hostname :web-serverDomain :example.comFQDN :web-server.example.comRoot Password :[password kuat 12+ karakter]User Name :adminUser Password :[password kuat]User Full Name :AdministratorNetwork Config :Method :Static / DHCPIP Address :192.168.1.10Netmask :255.255.255.0Gateway :192.168.1.1DNS :8.8.8.8, 1.1.1.1Timezone :Asia/JakartaLocale :en_US.UTF-8Keyboard :English (US)Partitioning :Guided / ManualFilesystem :ext4 / xfsUse LVM :Yes / NoEncrypt :Yes / No
TIPS: Simpan catatan ini di tempat aman! Password root dan user sulit di-reset jika lupa. Pertimbangkan gunakan password manager seperti Bitwarden atau KeePass.
KOMPETENSI SUB-BAB 01
Memahami checklist persiapan instalasi
Menentukan spesifikasi hardware yang sesuai
Mampu menyiapkan template catatan instalasi
02
SUB-BAB 02 BOOT
BOOT DARI MEDIA INSTALASI
Langkah Boot
1
MASUK BIOS/UEFI
1. Nyalakan server/VM.
2. Tekan tombol masuk BIOS/UEFI:
BRAND
TOMBOL BIOS
TOMBOL BOOT MENU
Dell
F2
F12
HP
F10 / Esc
F9
Lenovo
F1 / F2
F12
Asus
F2 / Del
F8 / Esc
Acer
F2 / Del
F12
VirtualBox
Host+D
Host+F12
VMware
F2
Esc
2
SET BOOT ORDER
1. Di BIOS, cari menu Boot atau Boot Order.
2. Set USB/CD sebagai first boot device.
3. Atau gunakan Boot Menu (one-time boot) untuk pilih device tanpa ubah BIOS.
4. Save & Exit (biasanya F10).
3
PILIH INSTALLER MODE
Setelah boot dari media, akan muncul GRUB menu Debian Installer:
GNU GRUB version 2.06
*Install
Graphical Install
Advanced options...
Expert install
Rescue mode
Check disc for defects
Pilihan menu:
MENU
FUNGSI
REKOMENDASI
Install
Installer text mode (default)
✓ Gunakan ini (paling stabil)
Graphical Install
Installer dengan GUI
Alternatif jika punya monitor
Expert install
Installer dengan semua opsi
Advanced users
Rescue mode
Rescue system yang rusak
Troubleshooting
Check disc
Verifikasi integritas media
Pertama kali install
Pilih Install (text mode) dan tekan Enter.
TIPS: Text mode lebih ringan dan stabil dibanding Graphical Install. Untuk server yang headless (tanpa monitor), text mode adalah pilihan terbaik.
KOMPETENSI SUB-BAB 02
Mampu masuk BIOS/UEFI dan set boot order
Memahami pilihan menu GRUB Debian Installer
Memilih mode instalasi yang tepat
03
SUB-BAB 03 CONFIG
KONFIGURASI AWAL INSTALLER
Language Selection
Langkah pertama installer adalah memilih bahasa. Untuk server, direkomendasikan English agar pesan error dan dokumentasi sesuai.
Select a language
*English
Bahasa Indonesia
Deutsch
Español
Français
Location & Keyboard
Select your location
United States
other
→ Asia
→Indonesia
Configure the keyboard
Country of origin: United States
Keyboard layout: English (US)
Detect keyboard layout? No
REKOMENDASI: Gunakan English (US) untuk keyboard layout. Layout ini universal dan memudahkan saat konfigurasi server via SSH dari berbagai client.
Loading Components
Installer akan me-load komponen dasar:
Detecting hardware
Mendeteksi CPU, RAM, disk, network card
Loading additional components
Load driver dan tools yang dibutuhkan
Configuring network
Detect network interfaces, DHCP/autoconfig
KOMPETENSI SUB-BAB 03
Mampu memilih language, location, keyboard
Memahami proses loading komponen installer
04
SUB-BAB 04 NETWORK
KONFIGURASI NETWORK
Detect Network Interfaces
Installer akan mendeteksi network interfaces yang tersedia:
Network interface selection
Network interfaces found:
→eth0 - eth0
eth1 - eth1
No network interfaces found
Pilih interface yang akan digunakan (biasanya eth0 atau ens33 untuk VM).
DHCP vs Static IP
Configure the network
Network configuration method:
→Auto (DHCP)
Manual
Do not configure the network at this time
Opsi 1: DHCP (Recommended untuk Belajar)
Pilih Auto (DHCP). Installer akan otomatis dapat IP dari DHCP server.
DHCP successful
Network configuration:
IP address : 192.168.1.100
Netmask : 255.255.255.0
Gateway : 192.168.1.1
DNS servers : 192.168.1.1
Domain : local
Opsi 2: Manual (Static IP)
Pilih Manual untuk set IP static. Cocok untuk server production.
IP address
Netmask
Gateway
Name server addresses
TIPS: Untuk server production, selalu gunakan Static IP. IP yang berubah-ubah akan menyulitkan akses remote dan konfigurasi service. Untuk belajar, DHCP sudah cukup.
Hostname & Domain
Setelah network dikonfigurasi, installer minta hostname dan domain:
Hostname
Domain name
(Leave empty if not part of a domain)
HOSTNAME RULES: Gunakan huruf kecil, angka, dan dash (-). Tidak boleh spasi atau karakter khusus. Contoh valid: web-server, db01, mail-server.
KOMPETENSI SUB-BAB 04
Mampu pilih network interface
Membedakan DHCP dan Static IP
Mampu konfigurasi network manual
Mampu set hostname dan domain
05
SUB-BAB 05 HOSTNAME
HOSTNAME & DOMAIN
Apa Itu Hostname?
Hostname adalah nama unik yang mengidentifikasi server dalam jaringan. Seperti nama orang, hostname memudahkan kita mengenali server tanpa harus hafal IP address.
KOMPONEN
CONTOH
DESKRIPSI
Hostname
web-server
Nama singkat server
Domain
example.com
Domain name
FQDN
web-server.example.com
Fully Qualified Domain Name (hostname + domain)
Konfigurasi Hostname (Setelah Install)
Setelah instalasi selesai, kamu bisa ubah hostname dengan command berikut:
PENTING: Setelah ganti hostname, edit juga /etc/hosts agar hostname baru bisa di-resolve. Jika tidak, beberapa service (seperti sudo, SSH) bisa error.
KOMPETENSI SUB-BAB 05
Memahami perbedaan hostname, domain, FQDN
Mampu cek dan ganti hostname dengan hostnamectl
Mampu edit /etc/hosts
06
SUB-BAB 06 USER
USER & PASSWORD
Root Password
Installer akan minta password untuk user root (superuser). Root memiliki akses penuh ke sistem - bisa melakukan apa saja termasuk merusak sistem!
Root password
Re-enter password to verify
PERINGATAN: Password root harus SANGAT KUAT! Minimal 12 karakter, kombinasi huruf besar/kecil, angka, simbol. Jangan gunakan password yang mudah ditebak!
User Account Biasa
Setelah root password, installer minta buat user account biasa. User ini untuk日常 penggunaan (bukan root).
Full name for the new user
Username for your account
Choose a password for the new user
Re-enter password to verify
Konfigurasi User Setelah Install
BASH
# Lihat user yang adacat /etc/passwd
↳ File berisi info semua user↳ Format: username:password:UID:GID:comment:home:shell# Lihat user dengan UID >= 1000 (user biasa)awk-F: '$3 >= 1000 {print $1}' /etc/passwd
↳ UID >= 1000 adalah user biasa (bukan system user)# Tambah user ke group sudo (agar bisa pakai sudo)sudo usermod-aG sudo admin
↳ -aG = append to group (tambah ke group tanpa hapus dari group lain)↳ sudo = group yang punya akses sudo# Verifikasi group usergroups admin
# admin : admin sudo# Ganti password usersudo passwd admin
↳ Ganti password untuk user admin# Ganti password rootsudo passwd root
↳ Ganti password root# Test sudosudo whoami
↳ Minta password user, lalu tampilkan "root"# root
Tips Password Kuat
KRITERIA
CONTOH LEMAH
CONTOH KUAT
Panjang
12345678
Min 12 karakter
Kompleksitas
password
P@ssw0rd!2026#Server
Personal Info
admin2026
Tidak ada nama/tgl lahir
Kamus
admin, root
Random phrase: K0p!Susu#B4ngunPgi
Reuse
Sama dengan email
Unik per server
TIPS: Gunakan passphrase daripada password. Passphrase adalah kalimat yang mudah diingat tapi sulit ditebak. Contoh: Kopi-Susu-Pagi-Hari-2026!
KOMPETENSI SUB-BAB 06
Mampu set root password yang kuat
Mampu buat user account biasa
Mampu tambah user ke group sudo
Mengenal kriteria password kuat
07
SUB-BAB 07 PARTITION
PARTISI DISK - GUIDED
Apa Itu Partisi?
Partisi adalah pembagian disk menjadi beberapa bagian logis. Setiap partisi bisa diformat dengan filesystem berbeda dan digunakan untuk tujuan berbeda (/, /home, /var, swap, dll).
Guided Partitioning (Recommended)
Installer akan tanya metode partisi:
Partition disks
Partitioning method:
→Guided - use entire disk
Guided - use entire disk and set up LVM
Guided - use entire disk and encrypt with LUKS
Manual
METODE
DESKRIPSI
USE CASE
Guided - entire disk
Partisi otomatis, simple
Pemula, VM testing
Guided - LVM
Dengan Logical Volume Manager
Production server, fleksibel
Guided - LUKS
Encrypted LVM
High security requirement
Manual
Partisi manual full control
Advanced users
1
PILIH DISK
Select disk to partition
→SCSI1 (0,0,0) (sda) - 21.5 GB VMware
Pilih disk yang akan dipartisi. Hati-hati pilih yang benar!
2
PARTITIONING SCHEME
Partitioning scheme
All files in one partition (recommended for new users)
→Separate /home partition
Separate /home, /var, and /tmp partitions
SCHEME
PARTISI
USE CASE
All files in one
/ + swap
Simple, untuk pemula
Separate /home
/ + /home + swap
User data terpisah
Separate /home, /var, /tmp
/ + /home + /var + /tmp + swap
Server production (RECOMMENDED)
3
CONFIRM & WRITE
Write the changes to disks?
→Yes
No
Installer akan format disk dan buat partisi sesuai skema yang dipilih.
Hasil Partisi (All files in one)
PARTISI
SIZE
MOUNT POINT
FILESYSTEM
/dev/sda1
~512 MB
/boot/efi
FAT32 (UEFI)
/dev/sda2
Remaining
/
ext4
/dev/sda3
~2x RAM
[swap]
swap
UEFI vs BIOS: Jika boot dari UEFI, akan ada partisi EFI (FAT32). Jika boot dari BIOS legacy, tidak ada partisi EFI. Installer otomatis detect.
KOMPETENSI SUB-BAB 07
Memahami konsep partisi disk
Membedakan metode partisi (guided vs manual)
Mampu pilih partitioning scheme yang tepat
08
SUB-BAB 08 PARTITION
PARTISI DISK - MANUAL
Kapan Pakai Manual?
Pilih Manual jika kamu butuh kontrol penuh atas partisi. Cocok untuk:
SERVER PRODUCTION
Pemisahan /var, /home, /tmp untuk security & backup
DATABASE SERVER
Partisi terpisah untuk data database
FLEKSIBILITAS
Resize partisi tanpa reinstall
SECURITY
Mount /tmp dengan noexec,nosuid
Langkah Partisi Manual
1
PILIH MANUAL
Partitioning method
Guided - use entire disk
Guided - use entire disk and set up LVM
→Manual
2
CREATE PARTITION TABLE
SCSI1 (0,0,0) (sda) - 21.5 GB VMware
→Create new empty partition table on this device
Konfirmasi Yes untuk buat partition table baru (akan hapus semua data!).
3
CREATE PARTITIONS
Buat partisi satu per satu dengan klik FREE SPACE → Create a new partition:
PARTISI
SIZE
TYPE
MOUNT POINT
OPTIONS
sda1
512 MB
Primary
/boot/efi
EFI System
sda2
1 GB
Primary
/boot
ext4
sda3
20 GB
Primary
/
ext4
sda4
20 GB
Primary
/var
ext4
sda5
10 GB
Logical
/tmp
ext4, noexec,nosuid,nodev
sda6
Remaining
Logical
/home
ext4
sda7
2x RAM
Logical
[swap]
swap area
Create a new partition (sda)
Type: →Primary / Logical
Location: →Beginning / End
Partition settings
Use as: →Ext4 journaling file system
Mount point: →/ - the root file system
Mount options: defaults
→Done setting up the partition
4
FINISH & WRITE
Setelah semua partisi dibuat, pilih Finish partitioning and write changes to disk.
Write the changes to disks?
→Yes
Rekomendasi Layout untuk Server
MOUNT POINT
MIN SIZE
RECOMMENDED
ALASAN
/boot
500 MB
1 GB
Kernel & bootloader files
/
10 GB
20 GB
Root filesystem, OS files
/var
10 GB
20-50 GB
Logs, databases, mail spool
/tmp
5 GB
10 GB
Temporary files, bisa di-mount noexec
/home
10 GB
Remaining
User data
swap
1x RAM
2x RAM
Virtual memory
TIPS: Untuk server production, pisahkan /var agar log yang membesar tidak memenuhi root partition. Pisahkan /home agar data user aman saat reinstall OS.
KOMPETENSI SUB-BAB 08
Mampu partisi disk secara manual
Mengenal mount point dan filesystem
Mampu merancang layout partisi untuk server
09
SUB-BAB 09 SOFTWARE
SOFTWARE SELECTION
Tasksel - Software Selection
Installer akan tanya software apa yang akan diinstall. Gunakan spasi untuk pilih/lepas, tab untuk navigasi, enter untuk konfirmasi.
Software selection
Choose software to install:
→ [ ] Debian desktop environment
... GNOME
... Xfce
... KDE
→[*] web server
→[*] SSH server
→[*] standard system utilities
[ ] print server
Rekomendasi untuk Server
SOFTWARE
INSTALL?
ALASAN
Debian desktop environment
❌ NO
Server tidak butuh GUI
... GNOME/XFCE/KDE
❌ NO
Desktop environment
web server
✓ YES
Jika butuh web server (Apache/Nginx)
SSH server
✓ YES
WAJIB untuk remote access
standard system utilities
✓ YES
Tools dasar (curl, wget, nano, dll)
print server
❌ NO
Kecuali butuh print server
TIPS: Untuk server production, hanya install yang dibutuhkan. Semakin sedikit package, semakin kecil attack surface dan semakin stabil sistem.
Proses Instalasi Package
Installer akan download dan install package yang dipilih. Proses ini bisa memakan waktu beberapa menit tergantung kecepatan internet.
Installing the base system
Installing base system...
[================> ] 50%
Current: base-files
KOMPETENSI SUB-BAB 09
Mampu pilih software yang tepat untuk server
Memahami tasksel dan package selection
Mengetahui proses instalasi package
10
SUB-BAB 10 BOOTLOADER
GRUB BOOTLOADER
Install GRUB
GRUB (GRand Unified Bootloader) adalah bootloader yang memuat kernel Linux saat boot. Installer akan tanya apakah install GRUB ke Master Boot Record (MBR).
Install the GRUB boot loader to the master boot record?
→Yes
No
Continue without boot loader
Device for boot loader installation
→/dev/sda
Enter device manually
PENTING: Pilih /dev/sda (disk), BUKAN /dev/sda1 (partisi). GRUB harus diinstall ke MBR disk, bukan partisi.
Finish Installation
Setelah GRUB terinstall, installer akan selesai:
Finish the installation
Installation complete
→Continue
Sistem akan reboot. Cabut USB/CD sebelum reboot agar tidak boot kembali ke installer.
KOMPETENSI SUB-BAB 10
Memahami fungsi GRUB bootloader
Mampu install GRUB ke MBR
Mengetahui proses finish installation
11
SUB-BAB 11 FIRST BOOT
FIRST BOOT
Login Pertama
Setelah reboot, kamu akan melihat login prompt:
CONSOLE
Debian GNU/Linux 12 web-server tty1web-server login: adminPassword: ••••••••Linux web-server 6.1.0-18-amd64 #1 SMP ...The programs included with the Debian GNU/Linux system are free software;the exact distribution terms for each program are described in theindividual files in /usr/share/doc/*/copyright.admin@web-server:~$
Mampu cek informasi sistem (OS, kernel, IP, disk, memory)
Memahami struktur output command dasar
12
SUB-BAB 12 REPOSITORY
KONFIGURASI REPOSITORY
Apa Itu Repository?
Repository adalah server yang menyimpan ribuan package Debian. Saat kamu install software dengan apt install, package didownload dari repository ini.
File sources.list
Konfigurasi repository ada di /etc/apt/sources.list:
BASH
# Lihat isi sources.listcat /etc/apt/sources.list
# deb http://deb.debian.org/debian/ bookworm main# deb http://deb.debian.org/debian/ bookworm-updates main# deb http://security.debian.org/debian-security bookworm-security main# Edit sources.listsudo nano /etc/apt/sources.list
# Format baris repository:# deb [URL] [distribution] [components]# deb = binary package# deb-src = source package (untuk compile)# Components:# main = Free software (DFSG-compliant)# contrib = Free software but depends on non-free# non-free = Non-free software# non-free-firmware = Non-free firmware (Debian 12+)
Konfigurasi Repository Lengkap
BASH
# Backup sources.list aslisudo cp /etc/apt/sources.list /etc/apt/sources.list.backup
# Edit sources.list dengan nanosudo nano /etc/apt/sources.list
# Ganti isi dengan:# Debian 12 (Bookworm) - Official Repositorydeb http://deb.debian.org/debian/ bookworm main contrib non-free non-free-firmwaredeb http://deb.debian.org/debian/ bookworm-updates main contrib non-free non-free-firmwaredeb http://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware# Simpan: Ctrl+O, Enter, Ctrl+X# Gunakan mirror Indonesia (lebih cepat)sudo nano /etc/apt/sources.list
# Ganti URL dengan mirror Indonesia:deb http://kartolo.sby.datautama.net.id/debian/ bookworm main contrib non-free non-free-firmwaredeb http://kartolo.sby.datautama.net.id/debian/ bookworm-updates main contrib non-free non-free-firmwaredeb http://kartolo.sby.datautama.net.id/debian-security bookworm-security main contrib non-free non-free-firmware# Mirror Indonesia populer:# - http://kartolo.sby.datautama.net.id/debian/# - http://kebo.pens.ac.id/debian/# - http://mirror.poliwangi.ee.itb.ac.id/debian/# - http://mirror.pdii.lipi.go.id/debian/# Update package listsudo apt update↳ Download daftar package terbaru dari repository# Hit:1 http://kartolo.sby.datautama.net.id/debian bookworm InRelease# Hit:2 http://kartolo.sby.datautama.net.id/debian bookworm-updates InRelease# Hit:3 http://kartolo.sby.datautama.net.id/debian-security bookworm-security InRelease# Reading package lists... Done# Building dependency tree... Done# All packages are up to date.
TIPS: Gunakan mirror Indonesia untuk download lebih cepat. Jika mirror lambat, bisa kembali ke official repository deb.debian.org.
KOMPETENSI SUB-BAB 12
Memahami konsep repository Debian
Mampu edit /etc/apt/sources.list
Mampu konfigurasi mirror Indonesia
Mampu jalankan apt update
13
SUB-BAB 13 UPDATE
UPDATE & UPGRADE SISTEM
Perbedaan Update vs Upgrade
COMMAND
FUNGSI
KAPAN PAKAI
apt update
Update daftar package dari repository
Sebelum install/upgrade
apt upgrade
Upgrade package ke versi terbaru
Setelah apt update
apt dist-upgrade
Upgrade + smart dependency handling
Upgrade besar, bisa remove/install package
apt full-upgrade
Sama dengan dist-upgrade
Alternatif nama
Langkah Update Sistem
BASH
# 1. Update package list (WAJIB pertama)sudo apt update↳ Download daftar package terbaru dari repository↳ Tidak upgrade package, hanya update daftar# 2. Upgrade packagesudo apt upgrade-y↳ -y = auto-yes, tidak tanya konfirmasi↳ Upgrade semua package ke versi terbaru↳ Tidak akan remove/install package baru# 3. Dist-upgrade (opsional, untuk upgrade besar)sudo apt dist-upgrade-y↳ Upgrade dengan smart dependency handling↳ Bisa remove/install package jika perlu↳ Gunakan dengan hati-hati!# 4. Autoremove (hapus package tidak terpakai)sudo apt autoremove-y↳ Hapus package yang tidak lagi dibutuhkan↳ Membersihkan dependency lama# 5. Autoclean (hapus cached package)sudo apt autoclean↳ Hapus cached .deb files yang obsolete# 6. Reboot (jika kernel diupdate)sudo reboot↳ Wajib reboot jika kernel diupdate# Cek apakah perlu rebootsudo ls /var/run/reboot-required
↳ Jika file ada, berarti perlu reboot
SSH (Secure Shell) adalah protokol untuk remote access ke server secara aman (encrypted). SSH menggantikan Telnet yang tidak aman. Dengan SSH, kamu bisa:
REMOTE TERMINAL
Akses command line server dari mana saja
FILE TRANSFER
SCP/SFTP untuk transfer file aman
ENCRYPTED
Semua data terenkripsi, aman dari sniffing
KEY-BASED AUTH
Login tanpa password dengan SSH key
Install SSH Server
BASH
# 1. Install OpenSSH Serversudo apt install openssh-server -y↳ Install package openssh-server↳ -y = auto-yes# Reading package lists... Done# The following NEW packages will be installed:# ncurses-term openssh-server openssh-sftp-server# 0 upgraded, 3 newly installed, 0 to remove# 2. Cek status SSH servicesudo systemctl status ssh
↳ Lihat status SSH service# ● ssh.service - OpenBSD Secure Shell server# Loaded: loaded (/lib/systemd/system/ssh.service; enabled)# Active: active (running) since ...# Docs: man:sshd(8)# 3. Enable SSH start on bootsudo systemctl enable ssh
↳ SSH akan otomatis start saat boot# Created symlink /etc/systemd/system/multi-user.target.wants/ssh.service# 4. Start SSH (jika belum running)sudo systemctl start ssh
# 5. Cek port SSHsudo ss-tulpn | grep ssh
↳ -t = TCP, -u = UDP, -l = listening, -p = program, -n = numeric# tcp LISTEN 0 128 0.0.0.0:22 0.0.0.0:* users:(("sshd",pid=...))# 6. Allow SSH di firewall (jika UFW aktif)sudo ufw allow ssh
↳ Allow SSH (port 22)# Rules updated# Atau allow specific portsudo ufw allow 22/tcp
Konfigurasi SSH
BASH
# Backup config aslisudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.backup
# Edit SSH configsudo nano /etc/ssh/sshd_config
# Konfigurasi penting:Port 2222↳ Ubah port SSH (default 22) untuk security by obscurityPermitRootLogin no↳ Disable root login via SSH (security)PasswordAuthentication no↳ Disable password auth (pakai key saja)PubkeyAuthentication yes↳ Enable key-based authenticationAllowUsers admin deploy↳ Hanya user tertentu yang bisa SSHAllowGroups sshusers↳ Hanya group tertentu yang bisa SSHMaxAuthTries 3↳ Max percobaan login sebelum disconnectClientAliveInterval 300↳ Keep-alive interval (detik)ClientAliveCountMax 2↳ Max missed keep-alive sebelum disconnect# Restart SSH setelah edit configsudo systemctl restart ssh
# Cek status setelah restartsudo systemctl status ssh
Test SSH Connection
DARI CLIENT LAIN
# SSH ke server (dari Windows/Linux/Mac)ssh admin@192.168.1.10
↳ Login sebagai user admin ke server# admin@192.168.1.10's password:# Linux web-server 6.1.0-18-amd64 ...# admin@web-server:~$# SSH dengan port customssh-p 2222 admin@192.168.1.10
↳ -p 2222 = specify port# SSH dengan verbose mode (debug)ssh-v admin@192.168.1.10
↳ -v = verbose, tampilkan detail koneksi# Copy file ke server (SCP)scp file.txt admin@192.168.1.10:/home/admin/
↳ Copy file.txt ke /home/admin/ di server# Copy file dari serverscp admin@192.168.1.10:/home/admin/file.txt .
↳ Copy file.txt dari server ke current directory# Copy directory (recursive)scp-r dir/ admin@192.168.1.10:/home/admin/
↳ -r = recursive, copy directory beserta isinya
TIPS: Untuk production server, selalu: (1) Ubah port default, (2) Disable root login, (3) Pakai SSH key, (4) Batasi user yang bisa SSH, (5) Pakai fail2ban untuk proteksi brute force.
SELAMAT! Kamu telah menyelesaikan Volume 02 - Instalasi Debian Server. Server kamu sekarang siap digunakan! Di Volume 03, kita akan belajar Command Line Essentials lebih mendalam. Sampai jumpa!
KOMPETENSI SUB-BAB 15
Mampu verifikasi instalasi berhasil
Mampu troubleshoot masalah umum
Mengenal file konfigurasi penting
VOLUME 02 SELESAI
SELAMAT!
Kamu telah menyelesaikan Volume 02 - Instalasi Debian Server dari nol. Dari persiapan hardware, boot media, konfigurasi installer, partisi disk, setup user & password, pemilihan software, instalasi GRUB, first boot, konfigurasi repository, update sistem, hingga instalasi SSH Server. Server Debian kamu sekarang siap digunakan untuk berbagai service. Di Volume 03, kita akan dalami Command Line Essentials. Sampai jumpa!