techinfoBiT
  • News
  • Startups
  • Tech
    • Internet
    • Security
  • WebMaster
    • All
    • SEO
    • Server & Hosting
    • Tools
    • WordPress
    'Sorry, This File Type Is Not Permitted for Security Reasons' How To Fix This Error in WordPress Website Development-techinfoBiT

    ‘Sorry, This File Type Is Not Permitted for Security Reasons’ How To Fix This Error in WordPress

    What is DMARC Record in DNS and Why It is Important For Email Security-techinfoBiT

    What is DMARC Record in DNS and Why It is Important For Email Security?

    How To Generate SHA-256 Hash From the Command Line on Ubuntu Server - techinfoBiT-SHA-256,Ubuntu Server, Server Solution, Linux Hashing, File Integrity, Cryptographic Hash, sha256sum, Hash Generation

    How To Generate SHA-256 Hash From the Command Line on Ubuntu Server

    Cloudflare To Deprecate Auto Minify Feature On August 5, 2024 - techinfoBiT

    Cloudflare To Deprecate Auto Minify Feature On August 5, 2024

    What is Google Analytics 4 and How to Setup GA4 for Websites - techinfoBiT

    What is Google Analytics 4 and How to Setup GA4 for Websites?

    How To Use Multiple SPF Records In A Domain | Merge Multiple SPF Easily - techinfoBiT

    How To Use Multiple SPF Records In A Domain | Merge Multiple SPF Easily

  • Science Space
  • Gadgets
    • Laptop & PCs
    • Mobile Phones
    • Wearables
  • More
    • How-To Guides
    • Reviews
    • Telecom
    • Applications
    • Press Release
No Result
View All Result
Services
techinfoBiT
  • News
  • Startups
  • Tech
    • Internet
    • Security
  • WebMaster
    • All
    • SEO
    • Server & Hosting
    • Tools
    • WordPress
    'Sorry, This File Type Is Not Permitted for Security Reasons' How To Fix This Error in WordPress Website Development-techinfoBiT

    ‘Sorry, This File Type Is Not Permitted for Security Reasons’ How To Fix This Error in WordPress

    What is DMARC Record in DNS and Why It is Important For Email Security-techinfoBiT

    What is DMARC Record in DNS and Why It is Important For Email Security?

    How To Generate SHA-256 Hash From the Command Line on Ubuntu Server - techinfoBiT-SHA-256,Ubuntu Server, Server Solution, Linux Hashing, File Integrity, Cryptographic Hash, sha256sum, Hash Generation

    How To Generate SHA-256 Hash From the Command Line on Ubuntu Server

    Cloudflare To Deprecate Auto Minify Feature On August 5, 2024 - techinfoBiT

    Cloudflare To Deprecate Auto Minify Feature On August 5, 2024

    What is Google Analytics 4 and How to Setup GA4 for Websites - techinfoBiT

    What is Google Analytics 4 and How to Setup GA4 for Websites?

    How To Use Multiple SPF Records In A Domain | Merge Multiple SPF Easily - techinfoBiT

    How To Use Multiple SPF Records In A Domain | Merge Multiple SPF Easily

  • Science Space
  • Gadgets
    • Laptop & PCs
    • Mobile Phones
    • Wearables
  • More
    • How-To Guides
    • Reviews
    • Telecom
    • Applications
    • Press Release
No Result
View All Result
techinfoBiT

How to Make File or Folder Immutable or Uneditable on Ubuntu Server

Nishant Kumar by Nishant Kumar
November 4, 2023
Reading Time: 3 mins read
Share on FacebookShare on Twitter > XShare via WhatsAppShare on LinkedIn

The file or folder on the server is the most important asset of any website or application; even a minute unintended change in a file or folder can result in making the website or application down. Every project contains some files or folder that needs even more attention, whether it is a configuration file in your home directory or a potentially vulnerable file or folder that needs additional care. The best way to prevent such files or folders is to make them immutable so that even the ‘root’ will have to make extra effort to edit/modify/delete them.

How to Make File or Folder Immutable or Uneditable on Ubuntu Server:

By changing the attributes you can easily make any file or folder immutable or uneditable, all you need is server SSH access. If you have SSH access then it can be done by running just a couple of commands. However, some files need to be updated and edited by the application or server tools to continue running the website or applications, even when you think that the specific file or folder is extremely critical you should not make them immutable unless you are sure about that it won’t affect the project. So make sure you test the website or application after adding or changing the attributes.

You might also like

Ubuntu Server How To Find Largest File In Directory Recursively - techinfoBiT

Ubuntu Server: How To Find Largest File In Directory Recursively

March 24, 2025
Buying an Affordable & High-Performance VPS or Web Hosting-Best VPS Offer-Hostinger-techinfoBiT Blog For-Best WordPress Hosting

Buying an Affordable & High-Performance VPS or Web Hosting

March 9, 2025

Follow these quick steps to make a file or folder immutable or uneditable on the Ubuntu server:

  • Login to your server using valid SSL credentials.
  • Navigate to the /directory where you have the file or folder you want to restrict.
  • Run the following command to make the file/folder immutable. Change the filename or folder name or their path with your target file or folder.
$ chattr +i filename or foldername
  • You can also use the direct path of the file and folder with the command as follows;
$ chattr +i /var/www/FolderName/MakeImmutable
$ chattr +i /var/www/FolderName/MakeImmutable.php
  • To check the attribute status, run the following command on your terminal;
$ lsattr filename or foldername
$ lsattr /var/www/FolderName/MakeImmutable.php
  • You should expect the output as follows, where the i tag represents it as immutable.
----i--------e-- filename

Once you run the command go back to the file using terminal or sFTP and try editing, renaming or deleting (be careful) the file or folder for which you just changed the attributes. It should show the permission denied error.

How to Remove the i Tag or Make File or Folder Editable Again?

Use the following command in the same way as the above process to remove the immutable attributes or i tag for a file or folder.

$ chattr -i filename or foldername

or

$ chattr -i /var/www/FolderName/MakeImmutable
$ chattr -i /var/www/FolderName/MakeImmutable.php

Additionally, you should have the proper file permission and ownership on all files and folders for better security and accessibility or performance of the website and application. We offer different digital solutions including services for server management and maintenance, you can reach out to us for professional support.

Tags: Change AttributechattrFolder ImmutableHow to BlogsMake File ImmutableMake File UneditableNginxServer AdminServer ManagementServer TutorialsUbuntu
ShareTweetSendShare
Previous Post

NASA Astronaut Frank Rubio Safely Returns to Earth, Spent 371 Days in Space

Next Post

The Ultimate Guide To Choosing the Right Career for You

Nishant Kumar

Nishant Kumar

Nishant is a passionate tech blogger and has been writing about technology since 2007. His insatiable love for gadgets has made him closely follow the advancements & innovations our society has made in terms of technology since a long while now. Nishant is a highly sought after reviewer with many manufacturers requesting his opinions about their products. He covers Mobile Phones, Gadgets, Tools and all kind of tech products to give consumers Genuine Reviews, Buying Guides and reliable news.

Related Articles

Ubuntu Server How To Find Largest File In Directory Recursively - techinfoBiT

Ubuntu Server: How To Find Largest File In Directory Recursively

by Nishant Kumar
March 24, 2025
0

When managing an Ubuntu Server, disk space can quickly become an issue, especially if large files accumulate unnoticed. If you need to identify the biggest file within a directory (including...

Buying an Affordable & High-Performance VPS or Web Hosting-Best VPS Offer-Hostinger-techinfoBiT Blog For-Best WordPress Hosting

Buying an Affordable & High-Performance VPS or Web Hosting

by Nishant Kumar
March 9, 2025
0

The Virtual Private Server (VPS) is now becoming a mainstream and popular hosting option for all kinds of websites and applications. The market share of Virtual Private Servers (VPS) has...

HowTo Fix Bluetooth Connection Issue in Ford EcoSport SYNC Audio-techinfoBiT

HowTo Fix Bluetooth Connection Issue in Ford EcoSport SYNC Audio

by Suyash Anand
February 28, 2025
0

The Ford EcoSport has always been a fun-to-drive vehicle, offering a feature-packed experience that many competitors struggle to match. Unfortunately, Ford has exited the Indian market, leaving many Ford owners...

How to Get Jio eSIM Online, Jio eSIM Activation Process, eSIM Registration. Jio eSIM Activation via SMS-telecom blog-techinfoBiT

How to Get Jio eSIM Online

by techinfoBiT
October 14, 2024
0

The best option among physical and eSIM is debatable since there are some pros and cons for both types of SIM options based on the individual users. The physical SIM...

Load More
Next Post
The Ultimate Guide To Choosing the Right Career for You - techinfoBiT

The Ultimate Guide To Choosing the Right Career for You

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *


This site uses Akismet to reduce spam. Learn how your comment data is processed.

techinfoBiT | Startup & Tech News, Reviews | WebMaster, How-To Guides-Tech Blog-Startup Blog India

techinfoBiT is your go-to source for the latest startup & tech news, technology reviews; WebMaster, SEO tips and how-to guides to help you stay updated and navigate the digital world know more

  • About
  • Contacts
  • Disclaimer
  • Privacy Policy

© 2012-2025 techinfoBiT | All Rights Reserved

No Result
View All Result
  • News
  • Startups
  • Tech
  • WebMaster
  • Gadgets
  • How-To Guides
  • Science Space
  • Services

© 2012-2025 techinfoBiT | All Rights Reserved