Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

You\'re a Linux help disk technician and just got a phone call from Chris Baxter

ID: 3880362 • Letter: Y

Question

You're a Linux help disk technician and just got a phone call from Chris Baxter, a new employee, who is having trouble running shell scripts. He tells you he has replaced the previous employee Aaron Cole, but he can't run any of Aaron's scripts. You check Chris's user account and discover he's a memeber of the division group. After using the ls -l command in the scripts directory, you see the following information:

ls -l

-rwxr--r--1 cole division 0 2009 - 02 -10 04:59 bank

-rwxr--r--1 cole division 0 2010 - 01 -04 04:59 database

-rwxr--r--1 cole division 0 2010 - 09 - 17 04:59 project

-rwxr--r--1 cole division 0 2011 - 07 - 23 04:59 school

Why can't Chris run the scripts listed in this output? What command should you use to give Chris the permission needed to run them?

Assuming you must address Chris Baxter’s help desk ticket by emailing him. Assume his user name is cbaxter.

Your email must explain to Chris why he cannot run the scripts.   It must cover two ways you can, as root (su) fix his problem. (One you know, chmod(1), the other, chown(1) you need to run the man command or Internet search on.) You must give Chris at least one pro and one con for each method.

Explanation / Answer

Hi Chris,

Please find below the detailed solution.

After observing the below output
ls -l

-rwxr--r--1 cole division 0 2009 - 02 -10 04:59 bank

-rwxr--r--1 cole division 0 2010 - 01 -04 04:59 database

-rwxr--r--1 cole division 0 2010 - 09 - 17 04:59 project

-rwxr--r--1 cole division 0 2011 - 07 - 23 04:59 school

all the scripts belong to user cole and it have the 744 permission means only root and user can execute(x) the
scripts so cole i the owner of that files.

Why can't Chris run the scripts listed in this output? What command should you use to give Chris the permission needed to run them?
Ans: if Chris added in sudoers group then can run the script by using sudo command like
sudo ./<script_name>
then it will ask the password.

first method:
User Chris can run the script the using sudo command.

second method:
IF owner of file will change to Chris then chris can run
change owner: below command need to run as sudo previlege
sudo chown Chris <script_name>
after firing the above command user Chris will owner of that file. and can run the script without using sudo command
./<script_name>

chmod is abbreviated for change mode is used set the permission of resources.
in linux read(r) permission identified as 4
write(w) as 2 and execute(x) as 1 so total max permission will be 7.

pro of chmod and sudo:
after changing the ownership he can do whatever with file with root privelege.
no need to chage the file permission , user can run another user's file with root privelege.

con of chmod and sudo:
If possible then give as nuch less permission to user to your file because it will be potentially harmful
to give full permission.
using sudo user can use another resources which might be sensitive and not supposed to use by user.

Hope this solution will help you out.
Please do let me know if you have any concern/queries.

Thanks,
Rakesh
Linux Help Desk

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote