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

Creating a Chrooted Environment

This lab will allow you to practice creating a chrooted environment, adding access to Linux commands, along with including shared libraries for these commands. You will create a chrooted jailed environment as well as ensuring the inmates can `cat` out the false escape plans that you will leave behind.

Google Cloud Platform icon
Lab platform
Lab Info
Level
Beginner
Last updated
Sep 16, 2025
Duration
30m

Contact sales

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

    Create a directory named /home/elba
    1. Once logged in to the server, become the root user using the command sudo su -. When prompted, enter the cloud_user password shown in the lab’s credentials section.

    2. Create a directory for elba within the /home directory.

       mkdir /home/elba
      
  2. Challenge

    Create a new user called napoleon.
    1. Create a new user for your environment named napoleon.

       useradd napoleon
      
  3. Challenge

    Create the bin and lib64 directories in /home/elba
    1. Create two new directories, bin and lib64, within the /home/elba directory.

       mkdir /home/elba/{bin,lib64}
      
  4. Challenge

    Copy /bin/bash into /home/elba/bin/bash.
    1. Copy /bin/bash into /home/elba/bin/bash.

       cp /bin/bash /home/elba/bin/bash
      
  5. Challenge

    Copy /bin/ls in to /home/elba/bin/ls
    1. Copy /usr/bin/ls into /home/elba/bin/ls.

       cp /bin/ls /home/elba/bin/ls
      
  6. Challenge

    Copy /bin/cat in to /home/elba/bin/cat
    1. Copy /bin/cat into /home/elba/bin/cat.

       cp /bin/cat /home/elba/bin/cat
      
  7. Challenge

    Copy the libraries needed for bash, ls, and cat over to /home/elba/lib64.
    1. Find and copy the libraries needed for bash, ls, and cat over to /home/elba/lib64.

      	ldd /bin/bash /bin/ls /bin/cat
      
      	cp /lib64/libtinfo.so.5  
      	/lib64/libdl.so.2 
      	/lib64/ld-linux-x86-64.so.2 
      	/lib64/libselinux.so.1 
      	/lib64/librt.so.1 
      	/lib64/libcap.so.2 
      	/lib64/libacl.so.1 
      	/lib64/libc.so.6 
      	/lib64/libpthread.so.0 
      	/lib64/libattr.so.1 
      	/lib64/libpcre.so.1  /home/elba/lib64
      
  8. Challenge

    Create the waterloo.txt file in the /home/elba directory
    1. Using vi, create the waterloo.txt file in the /home/elba directory with instructions on how to escape.

       vi /home/elba/waterloo.txt
      
  9. Challenge

    Create a chrooted environment in /home/elba with a bash shell.
    1. Using the chroot command, create a chrooted environment in /home/elba with a Bash shell.

       chroot /home/elba /bin/bash
      
  10. Challenge

    Confirm commands work.
    1. Using the command pwd, confirm the present working directory and then confirm that you can use the ls command.

      	pwd
      
      	ls
      
      	cat
      
  11. Challenge

    View the contents of waterloo.txt and find out how to escape your environment.
    1. View the contents of waterloo.txt and find out how to escape your environment.

       cat waterloo.txt
      
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