Hi,
I tried my first task which was to make the xfusioncorp.sh 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.
Hi,
I tried my first task which was to make the xfusioncorp.sh 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.
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>
.
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 filename.sh
I also completed the task, but it is showing failed. Below are the output:
[banner@stapp03 tmp]$ ls -l
total 8
-rwx------ 1 root root 836 Aug 1 2019 ks-script-rnBCJB
---------- 1 root root 40 Mar 2 17:36 xfusioncorp.sh
-rw------- 1 root root 0 Aug 1 2019 yum.log
[banner@stapp03 tmp]$ chmod +x xfusioncorp.sh
chmod: changing permissions of âxfusioncorp.shâ: Operation not permitted
[banner@stapp03 tmp]$ sudo chmod +x xfusioncorp.sh
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:
[banner@stapp03 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 xfusioncorp.sh
-rw------- 1 root root 0 Aug 1 2019 yum.log
[banner@stapp03 tmp]$ thor@jump_host ~$
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!
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.
Thanks,
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
Thanks,
KodeKloud Support
[Linux File Permissions Task
Iâve completed the task, but the end result failed; below is the information.
Youâve added the permissions just for group and not for other users - as was requested.
Tried again and failed
[root@stapp01 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 xfusioncorp.sh
-rw------- 1 root root 0 Aug 1 2019 yum.log
[root@stapp01 tmp]# ./xfusioncorp.sh
Welcome To KodeKloud
[root@stapp01 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 xfusioncorp.sh
Do this on whichever app server the task is asking. The server can change each time you are assigned it.
step 4 : exit
step 5 : sh filename.sh
step 6
Iâm able to execute the file without the read permission. Chat GPT says:
âIn Linux, execute permissions are required to run a file. If a file does not have execute permissions, you wonât be able to execute it directly. However, you can still execute a file without read permissions if the parent directory has execute permissions.â
/tmp/ has 777 permissions, so I can execute it without the read being set on the file directly. I think the question needs to be worded more specifically to what youâre after here. Technically speaking adding chmod +x would satisfy the requirements so long as itâs moved into. directory that doesnât have such open permissions. Am I off here? Still learning about this world so I get tripped up by details like this.