×

การทำหลังการติดตั้ง Ubuntu Linux

การทำหลังการติดตั้ง Ubuntu Linux

หลังจากติดตั้ง Ubuntu Server หรือ Ubuntu Desktop เสร็จแล้ว ควรทำ “Post-Installation Setup” เพื่อให้ระบบปลอดภัย เสถียร และพร้อมใช้งานมากขึ้น โดยรายการด้านล่างครอบคลุมทั้ง ระบบเซิร์ฟเวอร์ และ ผู้ใช้งานทั่วไป

 รายการ Post-Installation สำหรับ Ubuntu (Server/Desktop)

 1. อัปเดตระบบให้ทันสมัย

sudo apt update && sudo apt upgrade -y
sudo apt autoremove -y

 2. สร้างผู้ใช้ใหม่ & เพิ่มสิทธิ์ sudo (ถ้าใช้ root)

adduser yourname
usermod -aG sudo yourname

3. ติดตั้ง Firewall ด้วย UFW

sudo apt install ufw
sudo ufw allow OpenSSH
sudo ufw enable
sudo ufw status

4. เสริมความปลอดภัย SSH (Server เท่านั้น)

  • แก้ไขไฟล์ /etc/ssh/sshd_config

 
sudo nano /etc/ssh/sshd_config
# ปิดการล็อกอินด้วย root
PermitRootLogin no
# ปิดการใช้ password (ถ้ามี SSH key)
PasswordAuthentication no
 
sudo systemctl restart sshd

5. ติดตั้ง Software พื้นฐานที่จำเป็น

sudo apt install git curl wget net-tools unzip htop build-essential -y

 6. ติดตั้ง Snap และ Flatpak (Desktop)

sudo apt install snapd flatpak gnome-software-plugin-flatpak -y

 7. ตั้งเวลาให้ตรง และตั้งค่า Timezone

timedatectl set-timezone Asia/Bangkok
timedatectl set-ntp true

 8. ติดตั้ง Fail2Ban (สำหรับ Server ป้องกัน brute-force)

sudo apt install fail2ban -y

 9. ตั้งค่า Hostname และ /etc/hosts

sudo hostnamectl set-hostname your-hostname
sudo nano /etc/hosts
# เพิ่มบรรทัด: 127.0.1.1 your-hostname

10. เพิ่ม Monitoring Tools (สำหรับ Server)

  • เช่น cockpit, netdata, glances

sudo apt install cockpit -y
sudo systemctl enable --now cockpit.socket

 11. ตรวจสอบการใช้ดิสก์ / แรม

df -h
free -m
htop

12. ติดตั้ง Virtualization Tools (ถ้าเป็น VM)

sudo apt install qemu-guest-agent spice-vdagent -y

หมายเหตุ

  • สำหรับ Ubuntu Desktop > ควรเพิ่มแพ็กเกจ Flatpak, Multimedia codecs, Gnome Tweaks  สำหรับการใช้งาน

  • สำหรับ Ubuntu Server > ให้โฟกัสที่ SSH, Firewall, Monitoring, Docker/KVM