Linux File Permissions – Kodekloud Engineer Task

Linux File Permissions – Task Details

There are new requirements to automate a backup process that was performed manually by the xFusionCorp Industries system admins team earlier. To automate this task, the team has developed a new bash script xfusioncorp.sh. They have already copied the script on all required servers, however, they did not make it executable on one of the app servers i.e App Server 1 in Stratos Datacenter.

Please give executable permissions to /tmp/xfusioncorp.sh script on App Server 1. Also, make sure every user can execute it.

Note: The App Server might be different in your case.

Here I am going to show you the steps for Linux File Permissions on App Server 1 and you can follow the same steps for the App server mentioned in your Task details.

Step 1: From the Jump host login to App Server 1 using SSH details:

$ ssh tony@172.16.238.10

Enter the password provided to you to complete the authentication

Step 2: Change directory to /tmp/

$ cd /tmp/

Step 3: Give executable permissions to /tmp/xfusioncorp.sh script

$ sudo chmod 555 xfusioncorp.sh

This will give Read and Execute (-r-x r-x r-x) permissions to all the users.

Good luck with your task.

For more blogs click here

Start working on real time project with Kodekloud

1 thought on “Linux File Permissions – Kodekloud Engineer Task”

  1. The reason why read permission is needed along with executable permission is explained nicely in this post on stack exchange https://unix.stackexchange.com/a/34205
    Mentioning the gist of that post for convenience “The interpreter (bash, perl, python, etc.) needs to read the script. This is different from a regular program, like ls, in that the program is loaded directly into the kernel. The kernel itself is reading program file, it doesn’t need to worry about read access. The interpreter on the other hand needs to read the script file, as a normal file would need to be read.”

    Reply

Leave a Comment