Hey-yo!
Hi there, folks.
How are you folks doing where you’re at?
I’m sorry, I posted this 4th day laboratory a bit late. Honestly, I began contemplating about doing it tomorrow instead of today. However, I had another after-thought that I felt like cheating myself. If I still have enough, or some time today to do it. Why not do it, to also stay on track? Yes, my friends?
With this reflection.
I’m jumped onto this chair behind a desk. And started up my aging, small computer.
Okay.
For today, we have a task to modify the file permissions (for all users, groups, and whatnot) for a script (shell script, denoted with a file extension of *.sh).
It means, it’s a file containing text-based instructions for a computer when you run it.
However, there’s a catch to this file. A problem. And good people at Kode Kloud gave us a task to fix it.
To fix it.
We need to modify this script file’s permission. From no permissions. Into it becoming an executable. Meaning, a file that can be run (like an application program, if you invoke it).
So, okay. Let’s go.
First, we SSH into our application server where the file lives. We do this from our jumphost (called “thor”).

We “login” or ssh, using the username “steve”. Doing so, with this Linux command.
ssh steve@stapp02
You can do this.
Or, you can invoke the server SSH connection via the IP address of the server. If the hostname isn’t mapped to it yet.
Kindly don’t forget about the username for the app server (“steve”).
ssh steve@172.16.238.11
Enter your server’s password.
You can find it from the Kode Kloud Engineer’s infrastructure details.

Once logged in.
You’ll still need to ask or request the elevate your present privileges, to become “root”.
You’ll need the extra privileges in order to do necessary administrative tasks. Otherwise, you might see errors.
My friend, you elevate your user privileges to become “root” temporarily through this Linux command.
sudo su

Once you’re able to escalate privileges to root.
You must modify the script file’s permission for all users, groups, and whatnot. For it to become executable.
Once more, executable means your file behaves more like a standalone application program. That when you invoke it. Instead of displaying you its contents. The script will “execute” or run the instructions the author wrote in it.
Please do so with this command to make the file executable.
chmod +x /tmp/xfusioncorp.sh
Details about above Linux command.
- “chmod”: is a program in Linux that lets you change file permissions.
- “+x”: tells chmod to “add execute permissions” for all users of the file
- “/tmp/xfusioncorp.sh”: is the path and the filename and extension of our script file that we need to change the permissions for. It’s the file mentioned in our task containing some instructions when run, or read.
If you put these three (3) fragments together.
It tells Linux to please do the following:
- Hey. Linux, please change the file permission for this shell file (xfusioncorp.sh) found inside directory (or folder) /tmp/. And modify it to become an executable file (chmod +x).
However, folks after doing these set of steps.
And after verifying that we have changed the file permission of file.
I encountered a mistake, or I made a mistake. It made me wonder what was going on.
Huh?! But the permission (executable) was set right. Hmm. This needs further looking into, me thinks. Alright, let’s go!

For example, this screen shows that the file permission was changed and file is now executable.
However…

Our task is failing the Kode Kloud task correctness test.
If you look at the screen above, with the red “x” mark. It shows we made a mistake.
After a while, it made me think about something.
Folks, an executable file is good. Yes. However, if you can’t or don’t have “read” permissions.
You can’t execute or run the file, at all.
This could be, why our correctness test was failing.
With this in mind.
We try again. And do things, this time, enabling “read” permissions along with “execute” permissions.

Re-doing our task. We asked Linux to add “read” and “execute” permissions for the file.
chmod +rx /tmp/xfusioncorp.sh
Then, we verify that the permissions were set accordingly.

And this time, finally, after a number of failed attempts, we got it right.
We learn something new today, my friends. Yes folks?
We give our thanks.
Alright, that’s it for now.
If you’re also trying this laboratory for the 100 Days of DevOps. And if you find yourself stuck. Feel free to reach out. And if I can, I’ll help you.
Okay. Thanks.
God bless you.
Leave a Reply