Skip to content
Tutorial emka
Menu
  • Home
  • Debian Linux
  • Ubuntu Linux
  • Red Hat Linux
Menu

INI TIPS Hardening Security Linux: Disable CHMOD 777

Posted on January 31, 2024

Pada tutorial kali ini kita akan membuat sebuah script bantu, supaya linux kita lebih aman dengan membungkus/wrap tool chmod, sehingga kita bisa menambah keamaan server, seperti mencegah pengaturan izin 777. 

Berikut adalah contoh dasar cara membuat skrip tersebut di Ubuntu atau sistem berbasis Linux lainnya. 
Langkah 1: Membuat Skrip

Buka terminal dan gunakan editor teks untuk membuat skrip. 

Misalnya, menggunakan nano:
sudo nano /usr/local/bin/safe_chmod

Tambahkan konten berikut ke file:

#!/bin/bash
# Pembungkus skrip kustom untuk chmod agar mencegah pengaturan izin 777

# Periksa apakah salah satu argumen adalah '777'
for arg in "$@"; do
    if [ "$arg" == "777" ]; then
        echo "Error: Pengaturan izin 777 tidak diperbolehkan karena alasan keamanan."
        exit 1
    fi
done

# Jika 777 tidak ditemukan, jalankan perintah chmod asli dengan semua argumen
/bin/chmod "$@"

Langkah 2: Membuat Skrip Dapat Dijalankan

Simpan dan tutup file. 

Kemudian, buat skrip dapat dijalankan:

sudo chmod +x /usr/local/bin/safe_chmod

Langkah 3: Membuat Alias untuk Perintah chmod 

 Agar skrip dapat efektif menggantikan perintah chmod, Anda dapat membuat alias chmod menjadi safe_chmod. Ini dapat dilakukan dengan mengedit file .bashrc atau .bash_profile untuk setiap pengguna atau secara global di /etc/bash.bashrc:

echo "alias chmod='/usr/local/bin/safe_chmod'" >> ~/.bashrc
source ~/.bashrc

Kesimpulan dan Pertimbangan 

 Metode skrip pembungkus ini adalah cara sederhana dan efektif untuk mencegah penggunaan chmod 777, meningkatkan keamanan sistem Linux Anda. Namun, penting untuk dicatat bahwa metode ini tidak sepenuhnya aman. Pengguna dengan izin yang cukup dapat menghindari pembatasan ini, dan ini tidak menghentikan invokasi langsung dari /bin/chmod kecuali alias ada di tempat. 
 Oleh karena itu, strategi ini sebaiknya menjadi bagian dari pendekatan keamanan yang lebih luas yang mencakup pendidikan pengguna, praktik administrasi sistem yang tepat, dan audit secara teratur. Ingatlah, praktik keamanan terbaik melibatkan banyak lapisan perlindungan untuk melindungi sistem Anda secara efektif.

Recent Posts

  • How to Fix Excel Formula Errors: Quick Fixes for #NAME
  • How to Clear Copilot Memory in Windows 11 Step by Step
  • How to Show Battery Percentage on Windows 11
  • How to Fix VMSp Service Failed to Start on Windows 10/11
  • How to Fix Taskbar Icon Order in Windows 11/10
  • How to Disable Personalized Ads in Copilot on Windows 11
  • What is the Microsoft Teams Error “We Couldn’t Connect the Call” Error?
  • Why Does the VirtualBox System Service Terminate Unexpectedly? Here is the Full Definition
  • Why is Your Laptop Touchpad Overheating? Here are the Causes and Fixes
  • How to Disable All AI Features in Chrome Using Windows 11 Registry
  • How to Avoid Problematic Windows Updates: A Guide to System Stability
  • What is Microsoft Visual C++ Redistributable and How to Fix Common Errors?
  • What is the 99% Deletion Bug? Understanding and Fixing Windows 11 File Errors
  • How to Add a Password to WhatsApp for Extra Security
  • How to Recover Lost Windows Passwords with a Decryptor Tool
  • How to Fix Python Not Working in VS Code Terminal: A Troubleshooting Guide
  • Game File Verification Stuck at 0% or 99%: What is it and How to Fix the Progress Bar?
  • Why Does PowerPoint Underline Hyperlinks? Here is How to Remove Them
  • AI Bug Hunting with Semgrep
  • What is the Excel Power Query 0xc000026f Error?
  • How to Build Your Own Homelab AI Supercomputer 2026
  • How to Enable SSH in Oracle VirtualBox for Beginners
  • How to Intercept Secret IoT Camera Traffic
  • Build Ultra-Fast and Tiny Desktop Apps with Electrobun: A Beginner’s Guide
  • The Ultimate 2026 Coding Roadmap: How to Master Software Engineering with AI Agents
  • Inilah Rahasia ReciMe, Potensi Sukses dari Aplikasi Resep Sederhana
  • Perkuat Kemandirian Industri Alat Kesehatan Nasional, Astra Komponen Indonesia Hadirkan Alat Kesehatan Berbasis Teknologi Digital
  • Vidrush, Solusi Produksi Video massal buat Channel Faceless
  • Inilah Higgsfield AI Audio, Trik Canggih Buat Voice Cloning dan Dubbing Video Youtube Otomatis!
  • Everything You Need to Know About Project X and the Rumored AI-Powered Remaster of The Sims 4
  • How to Use Orbax Checkpointing with Keras and JAX for Robust Training
  • How to Automate Any PDF Form Using the Power of Manus AI
  • How to Training Your Own YOLO26 Object Detection Model!
  • How to Build a Full-Stack Mobile App in Minutes with YouWare AI
  • How to Create Consistent Characters and Cinematic AI Video Production with Seedance
  • Apa itu Spear-Phishing via npm? Ini Pengertian dan Cara Kerjanya yang Makin Licin
  • Apa Itu Predator Spyware? Ini Pengertian dan Kontroversi Penghapusan Sanksinya
  • Mengenal Apa itu TONESHELL: Backdoor Berbahaya dari Kelompok Mustang Panda
  • Siapa itu Kelompok Hacker Silver Fox?
  • Apa itu CVE-2025-52691 SmarterMail? Celah Keamanan Paling Berbahaya Tahun 2025
©2026 Tutorial emka | Design: Newspaperly WordPress Theme