Featured resource
2025 Tech Upskilling Playbook
Tech Upskilling Playbook

Build future-ready tech teams and hit key business milestones with seven proven plays from industry leaders.

Check it out
  • Lab
    • Libraries: If you want this lab, consider one of these libraries.
    • Cloud
Google Cloud Platform icon
Labs

Using File Attributes and Permissions

Both file attributes and permissions determine user and group access to files throughout the file system. Therefore, being able to use file attributes and permissions effectively is an essential system administrator skill. In this Hands-On lab, you will be using commands to view and set permissions and attributes for files. When the lab is complete, you should know how to use file attributes and permissions to control user and group access to files in the file system.

Google Cloud Platform icon
Lab platform
Lab Info
Level
Beginner
Last updated
Apr 06, 2025
Duration
15m

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.
Table of Contents
  1. Challenge

    View the Current Permissions of /opt/myapp/start.sh

    Let's see where we stand, as far as permissions go. Run ls -l and stat on the /opt/myapp/start.sh file:

    cd /opt/myapp
    ls -l start.sh
    stat start.sh
    
  2. Challenge

    Change Permissions on /opt/myapp/start.sh to Allow Full Privileges for User and Group Only

    Currently, the permissions of the file /opt/myapp/start.sh are rw-r--r--, or mode 644. We need the user and group to have all permissions and the others to have none. Using either command will have the same result:

    ls -l start.sh
    chmod u=rwx,g+wx,o-r start.sh
    ls -l start.sh
    stat start.sh
    chmod 770 start.sh
    stat start.sh
    
  3. Challenge

    Verify That /opt/myapp/start.sh Is Executable

    The permissions of the file /opt/myapp/start.sh should now be -rwxrwx--- or mode 770, and the file should execute. Look at the permissions again to make sure:

    stat start.sh
    

    Now let's try running it:

    ./start.sh
    
  4. Challenge

    Make the /opt/myapp/start.sh Immutable Using a File Attribute

    The i attribute should appear when we run lsattr on the file:

    lsattr start.sh
    

    If it doesn't, then we've got to set it:

    sudo chattr +i start.sh
    

    Verify that the file is set immutable:

    lsattr start.sh
    

    Note the use of sudo there. We've got to run chattr as root.

About the author

Pluralsight Skills gives leaders confidence they have the skills needed to execute technology strategy. Technology teams can benchmark expertise across roles, speed up release cycles and build reliable, secure products. By leveraging our expert content, skill assessments and one-of-a-kind analytics, keep up with the pace of change, put the right people on the right projects and boost productivity. It's the most effective path to developing tech skills at scale.

Real skill practice before real-world application

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Learn by doing

Engage hands-on with the tools and technologies you’re learning. You pick the skill, we provide the credentials and environment.

Follow your guide

All labs have detailed instructions and objectives, guiding you through the learning process and ensuring you understand every step.

Turn time into mastery

On average, you retain 75% more of your learning if you take time to practice. Hands-on labs set you up for success to make those skills stick.

Get started with Pluralsight