Imagine your team gives you a script named
backup.sh.
Before you run it, you need to check its permissions.To see the permissions of a file, you use
lswith the option-llike this:netops@automation:~/automation$ ls -l total 4 -rw-rw-r-- 1 netops netops 48 Nov 10 09:12 backup.sh
Figure 1 - The Permissions of backup.sh
rmeans read,wmeans write andxmeans execute.
A dash means that the permission is missing.No part has an
x, so nobody can runbackup.shyet.Answer the question below
In -rw-rw-r--, which letter is missing to run the file?
To add the execute permission to a file, you use the command
chmodwith+xlike this:netops@automation:~/automation$ chmod +x backup.sh netops@automation:~/automation$ ls -l total 4 -rwxrwxr-x 1 netops netops 48 Nov 10 09:12 backup.sh
Figure 2 - chmod +x Adds the Execute Permission
In the lab, make
backup.shexecutable to get the flag.Answer the question below
Enter the flag you obtained.
To run a script that is in your current directory, you type
./before its name like this:netops@automation:~/automation$ ./backup.sh Backing up R1
Figure 3 - ./ Runs a Script of the Current Directory
In the lab, you need to:
Make
backup.shexecutable.Run
backup.sh.
Answer the question below
Enter the flag you obtained.