Linux File Permissions Task


I tried my first task which was to make the script executable on app server 3. Attached is a screenshot of when i executed the script, but i failed the task. Just wanted to be sure. Thanks.

1 Like

You have to change the permissions of the file. Go to app server 3 and check the file permission of the xfusioncorp file using the command ls -la <file name> . Then based on what the current permissions are, change file access rights using chmod <binary> <file name>.

1 Like

Thank you, I will give it a try.

Guys, few of you might get froze in this task, follow the below steps

currently you will be jumpserver

step1; ssh [email protected] #pressenter
comments :(username) (ip address)

step2 : sudo su -

step 3 : chmod +rx

1 Like

I also completed the task, but it is showing failed. Below are the output:

[[email protected] tmp]$ ls -l
total 8
-rwx------ 1 root root 836 Aug 1 2019 ks-script-rnBCJB
---------- 1 root root 40 Mar 2 17:36
-rw------- 1 root root 0 Aug 1 2019 yum.log
[[email protected] tmp]$ chmod +x
chmod: changing permissions of ‘’: Operation not permitted
[[email protected] tmp]$ sudo chmod +x

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.

[sudo] password for banner:
[[email protected] tmp]$ ls -l
total 8
-rwx------ 1 root root 836 Aug 1 2019 ks-script-rnBCJB
—x–x–x 1 root root 40 Mar 2 17:36
-rw------- 1 root root 0 Aug 1 2019 yum.log
[[email protected] tmp]$ [email protected]_host ~$


Hello, @Anurag-Yadav
Please share your work in our “Review” section.

I also ran into the same issue as Anurag. The question asked for execute permissions to be granted to everyone and that is what I did and confirmed below. The only thing I can think of is maybe we were supposed to also include read access? But would be a bit confused if that’s the case due to how the question was worded. Please let me know what I did incorrectly. Thank you!

Hi @zachary8495 try with chmod 777 <file>.

KodeKloud Support

Thanks Vitor.

I’m still a bit confused as to why we would need to use chmod 777. Wouldn’t that provide all permissions (r,w,x) and not just execute? Can you please help me understand why only providing execute permissions is not appropriate in this situation? Thank you!

Maybe the text must be reviewed, but my first tough would be: if I’m giving execution privileges, maybe the user would have to read the content or even change it. Again, it depends on the context of the question. But I think if you use 777, it will be ok. Try it when you have a chance and let me know. :slight_smile:

KodeKloud Support

Ahh I see what you mean - how can a file be executed if the shell trying to execute cannot read the file? I looked around for additional clarification and found this post : linux - how to grant execute permission without read permission? - Super User

It makes sense that in order for a shell to execute a script it needs to be able to read the file to understand what it is executing. As an additional question, does this mean that in order to have execute permissions you must have read permissions, or do you also need write permissions to? I can see why someone would want to have write permissions, but not necessarily why they would need them, unless I am not thinking of something critical.

So, to execute, you’ll need at least chmod a+x,u+r teste-permissions. Don’t permitting to write to it can be a good security practice. This is very common, especially with stick bit where hackers can benefit from it :slight_smile:

KodeKloud Support

1 Like

[Linux File Permissions Task

I’ve completed the task, but the end result failed; below is the information.

Hi @dino.farinha ,
Please share the “Review” link here. So we can take a look at it.


You’ve added the permissions just for group and not for other users - as was requested.

Tried again and failed

[[email protected] tmp]# ls -l
total 8
-rwx------ 1 root root 836 Aug 1 2019 ks-script-rnBCJB
---------x 1 root root 40 Aug 2 11:03
-rw------- 1 root root 0 Aug 1 2019 yum.log
[[email protected] tmp]# ./
Welcome To KodeKloud
[[email protected] tmp]#

Seems that permission (and even creating or copying the missing script file) needs to be on the 3 app servers.

Even if the description says that you must apply permissions to file on server 3, at the beginning explains that the script must be deployed on all the app servers.

I thought it after giving permissions on server 3 and receiving this failure message:

- 'script' is not executable on App Server 1

To make a file executable, it must also be readable.
The easiest way to do this (for all users) is

sudo chmod +rx

Do this on whichever app server the task is asking. The server can change each time you are assigned it.

1 Like

step 4 : exit
step 5 : sh
step 6 :beers: