Mac

Ask Mac Questions and Get Answers from Experts ASAP

Ask a Computer Expert,
Get an Answer ASAP!

Mac
This answer was rated:

Unix Question has been asked before. You have been asked

<p>Unix Question has been asked...
<p>Unix Question has been asked before. Question is due 3/21 </p><p>You have been asked by your manager to develop a shell program to automate the security scheme you implemented in a prior project. This is a continuation of your earlier work. You must give the appropriate commands for the appropriate permissions and ownership for all of the files and directories in sales and shipping. You will create the necessary script(s) to implement the security scheme designed previously. You must test whether a file or directory exists before creating it. If a directory or file does exist, make the appropriate permission changes. You decide how to handle the situation where the file or directory does not exist. Then, discuss the various commands, techniques, and/or tools you would use to create the script(s). Note to students: You need access to the UNIX operating system. However, do NOT install UNIX on the PC you normally use. You can install UNIX on a second PC. If that is not possible, you can download a UNIX emulator, which runs under Microsoft Windows. The recommend emulator can be found at the website listed under Unit Resources for this course. You can do everything you need for this class using this emulator. You may have to install it twice; the second time you will need to choose the "vim" or "vi" editor.  </p><p>Details for this are:</p><p>You are to prepare a document regarding security of a proposed KTC system. Your manager wants you to discuss the necessary commands to assign the proper security permissions to the directories below. You are to assume the directory hierarchy currently exists. Note that each item in the graphic below is a directory. Shipping contains a directory name Out for outgoing shipments and a directory named In for incoming shipments. The sales directory has two regions in this scenario: Directory A for region A and directory B for region B.</p><p><img src="http://www.justanswer.com/courses/CS124/Assignment_Assets/2_p2ips.gif" alt="" width="28" height="30" /></p><p>There is a file in the Out directory named <strong>Out1.dat</strong>. There are two files in the In directory: One is named <strong>In1.dat</strong> and the other is named <strong>In2.dat</strong>. Directory A contains the files <strong>A1.dat</strong> and <strong>A2.dat</strong>. Directory B contains the files <strong>B1.dat</strong>, <strong>B2.dat</strong> and <strong>B3.dat</strong>.</p><p> </p><p>There are three groups of users: managers, shippers and sales representatives. Users Pat and Mary are members of the managers group, users Mike and Ving are members of the shipping group, and users Denise, Bob, and Sally are members of the sales group. Denise is a sales supervisor, and Bob and Sally are sales representatives. Bob and Sally must be able to open and modify all files in shipping. Bob is in charge of region A and Sally is in charge of region B. </p><p> </p><p>It has been determined that the current permissions of the files and directories for shipping must be as defined below:</p><p>The shipping directory must be owned by Pat. The group owner of shipping must be managers. The permissions of shipping must be read, write, and execute for Pat, and read and execute for all the others.</p><p>Mike must be the owner of the directory named Out. The group owner of Out must be shippers. The permissions of Out must be read, write, and execute for the owner, read and execute for members in shipping, and read for all the others. Mike must be the owner of all of the files in the Out directory. Users only need to open and modify the files in Out.</p><p>The In directory must be owned by Ving. The group owner of In must be a shipper. The permissions of In must be read, write, and execute for the owner, and read and execute for all others. Ving needs to open, modify, and run the files in the In directory. Shippers only need to open and modify the files in the In directory, and everyone else should only be able to open the files.</p><p>You are charged with the task of discussing the commands needed to create the appropriate permissions for the shipping directory and its subdirectories and files. Give the commands you would use to implement the security requirements for shipping. Additionally, you are to propose a possible security scheme similar in nature to the shipping requirements for the sales directory. Explain the reasons why you are assigning certain permissions and owners (user and group) to the files and directories in sales. Also, give the commands you used in support of your proposal. Prepare a document discussing your implementation of security for KTC.  This is the structure of directories</p><p><img src="http://s3.amazonaws.com/f01.justanswer.com/PLByjoule/2011-03-16_084822_2_p2ips.gif" alt="graphic" width="226" height="157" /></p>
Show More
Show Less
Ask Your Own Mac Question
Answered in 4 hours by:
3/16/2011
OSXpert
OSXpert, Mac Software Engineer
Category: Mac
Satisfied Customers: 226
Experience: 2 years as a geek squad computer technician, 5 years as a software engineer and unix systems admin
Verified

OSXpert :

Hi, my name is Britton. Are you available?

OSXpert :

Let's tackle the first problem -- also, I have somewhat of a moral dilemma just giving you the answer to these. Work with me and we'll get you all set.

First, the 'stat' (/usr/bin/stat) command is going to be your friend for the first problem. Not only will it tell you if a file exists, it will also tell you what kind of file it is (e.g. regular file, directory file, named pipe, etc...), it will also tell you the owner, group and the current permissions.

Essentially, you want to run 'stat <filename>' on each file. If stat returns a non-zero number, the file doesn't exist or there was another problem with the file. If stat returns 0, the file. exists and you can read the permissions/owner.

I'll be available for most of today, let me know when you're logged in and I'll get you going in the right direction

OSXpert
OSXpert, Mac Software Engineer
Category: Mac
Satisfied Customers: 226
Experience: 2 years as a geek squad computer technician, 5 years as a software engineer and unix systems admin
Verified
OSXpert and 87 other Mac Specialists are ready to help you
Ask your own question now
Customer reply replied 6 years ago
Please email me so we can get together on this question.
What is the objective of the assignment? Are you supposed to write a script or are you just supposed to explain in writing how to accomplish the problem in your description?
Ask Your Own Mac Question
Customer reply replied 6 years ago

A 1 to 3 page word document. The first part is the assignment and the second part that starts with Details for this are: from there including the picture is the preassignment I already finished. so the first part is what I'm looking for since I got an F on the preassignment and don't have a clue what I'm doing.

Please post the URL to the assignment. The description you put on Justanswer.com has a bunch of HTML elements and it's difficult to read. Second, It will be much easier for me if I can see the original questions.

Here are the commands needed for the preassignment:

chown Pat.managers shipping

chown stands for change owner. The "Pat.managers" part signifies you want the owner to be "Pat" and the group to be "managers". The "shipping" part is the name of the directory, "shipping"

chmod 755 shipping

chmod stands for change mode. Let's break down the 755 above. 7 indicates read, write and execute permission for the OWNER of the directory. We get the 7 from the binary addition of read, write, and execute. The value of read = 4, the value of write = 2 and the value of execute = 1. Add them together, 4+2+1=7, so, 7 denotes permissions of read, write and execute.

The 5 indicates the permissions for member of the GROUP of the directory. We get the 5 from binary addition of read and execute. Again, read = 4, execute = 1. Add them together 4+1=5, thus 5 denotes permissions of read and execute for members of the group.

The last 5 indicates the permissions for all OTHER members (non-owner and non-group). Just remember read=4, write=2 and execute=1. If you remember those, you can always figure out the permissions needed to be given to the chmod command.

chown Mike.shippers Out

This makes Mike the owner and shippers the group of the directory Out.

chmod 754 Out

7 = read, write, execute for the OWNER, Mike
5 = read, execute for the GROUP, shippers
4 = read permission for all OTHER users

chown Mike Out/*

This means change the owner of all (*) the files in the Out/ directory to "Mike"

chmod 666 Out/*

This means change the mode (permissions) of all (*) the files in the Out/ directory to read, write. Again:

read = 4
write = 2
4+2 = 6 for all users, thus 666 (6 for OWNER, 6 for GROUP and 6 for OTHER)

chown Ving.shippers In

Change the owner of the "In" directory to Ving and the group owner to "shippers"

chmod 755 In

Change the permissions for the "In" directory to read, write, execute for the owner. Read, execute for the group and read execute for all other users.

chmod 764 In/*

Change the permissions for all files (*) in the "In" directory to read, write, execute for the owner. Read, write for the group, and read for all other users.
Ask Your Own Mac Question
Customer reply replied 6 years ago

It's too late for the preassignment I already got a grade on it. So here is the current one that I need help on.

You have been asked by your manager to develop a shell program to automate the security scheme you implemented in a prior project. This is a continuation of your earlier work. You must give the appropriate commands for the appropriate permissions and ownership for all of the files and directories in sales and shipping. You will create the necessary script(s) to implement the security scheme designed previously. You must test whether a file or directory exists before creating it. If a directory or file does exist, make the appropriate permission changes. You decide how to handle the situation where the file or directory does not exist. Then, discuss the various commands, techniques, and/or tools you would use to create the script(s). Note to students: You need access to the UNIX operating system. However, do NOT install UNIX on the PC you normally use. You can install UNIX on a second PC. If that is not possible, you can download a UNIX emulator, which runs under Microsoft Windows. The recommend emulator can be found at the website listed under Unit Resources for this course. You can do everything you need for this class using this emulator. You may have to install it twice; the second time you will need to choose the "vim" or "vi" editor.

Customer reply replied 6 years ago

Hello? Are you still helping me or no?

I'm still here -- but like I asked before, please send me the actual LINK to the assignment. When you paste in the description, it loses all formatting (paragraph breaks, spacing, etc...) making this increddibly hard to follow.
Ask Your Own Mac Question
Customer reply replied 6 years ago
You would have to log into the link since I'm a member to it. Otherwise you can't see the question.
Customer reply replied 6 years ago

Here is the question I've acctually typed this in so that formating won't be a problem.

You have been asked by your manager to develop a shell program to automate the security scheme you implemented in a prior project. This is a continuation of your earlier work. You must give the appropriate commands for the appropriate permissions and ownership for all of the files and directories in sales and shipping. You will create the necessary script(s) to implement the security scheme designed previously. You must test whether a file or directory exists before creating it. If a directory or file does exist, make the appropriate permission changes. You decide how to handle the situation where the file or directory does not exist. Then, discuss the various commands, techniques, and/or tools you would use to create the script(s). Note to students: You need access to the UNIX operating system. However, do NOT install UNIX on the PC you normally use. You can install UNIX on a second PC. If that is not possible, you can download a UNIX emulator, which runs under Microsoft Windows. The recommend emulator can be found at the website listed under Unit Resources for this course. You can do everything you need for this class using this emulator. You may have to install it twice; the second time you will need to choose the "vim" or "vi" editor.

Great, thanks. But now I'm a little confused, I thought you needed to write a 1-3 page paper. Do you need to write a script (small software program) or an actual paper (e.g. typed in Microsoft Word)?
Ask Your Own Mac Question
Customer reply replied 6 years ago
It says script and 1 to 3 page word document.
Customer reply replied 6 years ago

Ok, here is something I've been thinking.

if [ -f fileA.dat ]

then

echo "The file exists"

else

touch fileA.dat

echo "File created"

fi

You're off to a good start. A couple of things...first, run this command:

which bash

It will probably return with "/bin/bash" -- you need to put this at the top of your script in the following format:

#!/bin/bash

Extend your script a little bit to check for directories and traverse them like this:

#!/bin/bash

if [ ! -d Shipping ]
then
mkdir Shipping
fi

chown Pat:managers Shipping
chmod 755 Shipping
cd Shipping

if [ ! -d Out ]
then
mkdir Out
fi

chown Mike:shippers Out
chmod 754 Out

cd Out

if [ ! -f Out1.dat ]
then
touch Out1.dat
fi

chmod 666 Out1.dat

cd ..

if [ ! -d In ]
then
mkdir In
fi

chown Ving:shippers In

cd In

if [ ! -f In1.dat ]
then
touch In1.dat
fi

if [ ! -f In2.dat ]
then
touch In2.dat
fi

chmod 764 In1.dat In2.dat

cd ../../



This should create the entire Shipping/ directory tree including files. Run it on your system and ensure I didnt make any mistakes. I can only run it to som extent on my system because I don't have the users/groups for the assignment.

Also, please copy the entire assignment, paste it into a word document (or some format the RETAINS formatting) and upload it to:

www.wikisend.com

Check my script for errors by running it on your system. Also, you may want to add some echo statements that will say things like "directory exists / doesnt exist" etc...
OSXpert
OSXpert, Mac Software Engineer
Category: Mac
Satisfied Customers: 226
Experience: 2 years as a geek squad computer technician, 5 years as a software engineer and unix systems admin
Verified
OSXpert and 87 other Mac Specialists are ready to help you
Ask your own question now
Customer reply replied 6 years ago

Thanks, XXXXX XXXXX would just subsitute sales for shipping for the other side?

 

Customer reply replied 6 years ago
Uploaded as P4IP.docx
Pretty much. Take a shot at it and upload the script to wikisend.

Also, you need to post the link to the file you uploaded to wikisend. Post the entire link for the assignment and the updated script here and I'll take a look at it later today.
Ask Your Own Mac Question
Status check -- as I recall, your assignment is due tomorrow. Just wanted to check and see how things are going.
Ask Your Own Mac Question
Customer reply replied 6 years ago
I submitted the script with some modifications hope it turns out well.
Good deal, let me know how it goes. I enjoy working on Unix problems and would like to help you in the future if you're interested. You can send future questions to me directly here:

http://www.justanswer.com/profile.aspx?PF=50723742&FID=0
Ask Your Own Mac Question
Ask OSXpert Your Own Question
OSXpert
OSXpert
OSXpert, Mac Software Engineer
Category: Mac
Satisfied Customers: 226
226 Satisfied Customers
Experience: 2 years as a geek squad computer technician, 5 years as a software engineer and unix systems admin

OSXpert is online now

A new question is answered every 9 seconds

How JustAnswer works:

  • Ask an ExpertExperts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional AnswerVia email, text message, or notification as you wait on our site. Ask follow up questions if you need to.
  • 100% Satisfaction GuaranteeRate the answer you receive.

JustAnswer in the News:

Ask-a-doc Web sites: If you've got a quick question, you can try to get an answer from sites that say they have various specialists on hand to give quick answers... Justanswer.com.
JustAnswer.com...has seen a spike since October in legal questions from readers about layoffs, unemployment and severance.
Web sites like justanswer.com/legal
...leave nothing to chance.
Traffic on JustAnswer rose 14 percent...and had nearly 400,000 page views in 30 days...inquiries related to stress, high blood pressure, drinking and heart pain jumped 33 percent.
Tory Johnson, GMA Workplace Contributor, discusses work-from-home jobs, such as JustAnswer in which verified Experts answer people’s questions.
I will tell you that...the things you have to go through to be an Expert are quite rigorous.

What Customers are Saying:

Hi John, Thank you for your expertise and, more important, for your kindness because they make me, almost, look forward to my next computer problem. After the next problem comes, I'll be delighted to correspond again with you. I'm told that I excel at programing. But system administration has never been one of my talents. So it's great to have an expert to rely on when the computer decides to stump me. God bless, Bill

Bill M.Schenectady, New York

The Expert answered my Mac question and was patient. He answered in a thorough and timely manner, keeping the response on a level that could understand. Thank you!

FrankCanada

My Expert answered my question promptly and he resolved the issue totally. This is a great service. I am so glad I found it I will definitely use the service again if needed.

One Happy CustomerNew York

Wonderful service, prompt, efficient, and accurate. Couldn't have asked for more. I cannot thank you enough for your help.

Mary C.Freshfield, Liverpool, UK

This expert is wonderful. They truly know what they are talking about, and they actually care about you. They really helped put my nerves at ease. Thank you so much!!!!

AlexLos Angeles, CA

Thank you for all your help. It is nice to know that this service is here for people like myself, who need answers fast and are not sure who to consult.

GPHesperia, CA

I couldn't be more satisfied! This is the site I will always come to when I need a second opinion.

JustinKernersville, NC

< Previous | Next >

Meet the Experts:

Mike

Mike

Mac Medic

8,555 satisfied customers

Over 20 years IT experience with Apple computers in publishing, marketing and design.

Daniel

Daniel

Mac Genius

4,711 satisfied customers

Apple certified on desktop and portable, help desk qualified. Have owned and used Macs since 1989.

Vinod Menon

Vinod Menon

Support Specialist

2,394 satisfied customers

worked as a Tech support Associate for Apple products

John T. F.

John T. F.

Mac Druid

1,994 satisfied customers

20+ years in the computer/Mac industry

David

David

Mac Support Specialist

1,507 satisfied customers

BSc H.Dip Apple Certified Professional

Claws224

Claws224

IEEE Datacommunication Engineer

965 satisfied customers

IEEE, Microsoft

Mac Tech

Mac Tech

Apple Specialist

888 satisfied customers

7 + Years Supporting Apple Products

< Previous | Next >

Related Mac Questions
I have purchased a new Mac and downloaded my files from my
I have purchased a new Mac and downloaded my files from my external back up drive. Everything seems to be working except my mail account. I have a hotmail account which downloads as mail on my laptop … read more
Justin Johnson
Justin Johnson
Training and Development Contractor
1,125 satisfied customers
I have recentley purchased a new I phone 8s. I went to a
Hi! I have recentley purchased a new I phone 8s. I went to a telstra shop to buy and get phone setup. They couldnt transfer my contacts from my old phone and have told me to contact Apple to restore m… read more
Justin Johnson
Justin Johnson
Training and Development Contractor
1,125 satisfied customers
When I turn on my ipad it is telling me that Activation
When I turn on my ipad it is telling me that Activation required … read more
Justin Johnson
Justin Johnson
Training and Development Contractor
1,125 satisfied customers
It won't accept my Apple ID that goes with my Ipad. 10.5 or
It won't accept my Apple ID that goes with my Ipad … read more
Justin Johnson
Justin Johnson
Training and Development Contractor
1,125 satisfied customers
I have a large popup windows code oxc-1900 208 can you stop
I have a large popup windows code oxc-1900 208 can you stop the popup … read more
Justin Johnson
Justin Johnson
Training and Development Contractor
1,125 satisfied customers
I Connot get password to take and it says that apple account
I Connot get password ***** take and it says that apple account locked … read more
Richard
Richard
IT Manager
IT Manager, Consultant
3,281 satisfied customers
I cant get into my iPhone 5s. It wants me to put in my
I cant get into my iPhone 5s. It wants me to put in my password ***** used when I first got my phone but I don't remember it. I do know my I.D. … read more
Richard
Richard
IT Manager
IT Manager, Consultant
3,281 satisfied customers
I don't remember the password for the iCloud account. I
I don't remember the password ***** the iCloud account … read more
Richard
Richard
IT Manager
IT Manager, Consultant
3,281 satisfied customers
I did sent you a request a few weeks ago and I am wondering
Hi Jason, I did sent you a request a few weeks ago and I am wondering if I missed your reply, as I understand now that a reply was sent and I might not have seen it. Can you send it again. … read more
Kris R
Kris R
IT Manager
Computing
2,652 satisfied customers
Want to know how I can get kendel books on my I pad. I have
Want to know how I can get kendel books on my I pad. I have an app, … read more
AnswersByEric
AnswersByEric
Software Developer
Associate Degree
37 satisfied customers
Reset ipad but still linked to itunes apple account. not
hi reset ipad but still linked to itunes apple account. not able to contact previous owner to remove/delete itunes/apple account. can you help … read more
Richard
Richard
IT Manager
IT Manager, Consultant
3,281 satisfied customers
I am locked out of my Ipad and cannot down load any apps
i am locked out of my Ipad and cannot down load any apps because i forgot my apple Id. i never use it and the credit card they have on file is an old one so i cannot get into it that way. it says i ha… read more
Justin Johnson
Justin Johnson
Training and Development Contractor
1,125 satisfied customers
I cannot get anything on my screen except the apple logo. I
Hi I cannot get anything on my screen except the apple logo … read more
Justin Johnson
Justin Johnson
Training and Development Contractor
1,125 satisfied customers
Want to cancel my Icloud storage plan, My computer is
If I cant cancel because of a security question I forgot I would need to transfer the deduction (99cents) from my credit card to my checking acct… read more
RussellA
RussellA
Solutions Architect
Bachelor\u0027s Degree
123 satisfied customers
My DVR4000 DVD + VCR Combo just won't turn on;; used to work
My DVR4000 DVD + VCR Combo just won't turn on;; used to work fine, but haven't used it in 2-3 years; … read more
Justin Johnson
Justin Johnson
Training and Development Contractor
1,125 satisfied customers
I purchased a new Apple MacBook Air. Went through the set up
I purchased a new Apple MacBook Air. Went through the set up routine and then didn't get a chance to use the machine for a few days. When I went to log in … read more
Justin Johnson
Justin Johnson
Training and Development Contractor
1,125 satisfied customers
My mac wont pass the login screen. I enter the password and
my mac wont pass the login screen . I enter the password ***** it doesn't seem to load … read more
Justin Johnson
Justin Johnson
Training and Development Contractor
1,125 satisfied customers
I am trying to allow download from anywhere, but am locked
I am trying to allow download from anywhere, but am locked out. It just shakes when I enter password. … read more
Justin Johnson
Justin Johnson
Training and Development Contractor
1,125 satisfied customers
Disclaimer: Information in questions, answers, and other posts on this site ("Posts") comes from individual users, not JustAnswer; JustAnswer is not responsible for Posts. Posts are for general information, are not intended to substitute for informed professional advice (medical, legal, veterinary, financial, etc.), or to establish a professional-client relationship. The site and services are provided "as is" with no warranty or representations by JustAnswer regarding the qualifications of Experts. To see what credentials have been verified by a third-party service, please click on the "Verified" symbol in some Experts' profiles. JustAnswer is not intended or designed for EMERGENCY questions which should be directed immediately by telephone or in-person to qualified professionals.

Disclaimer: Information in questions, answers, and other posts on this site ("Posts") comes from individual users, not JustAnswer; JustAnswer is not responsible for Posts. Posts are for general information, are not intended to substitute for informed professional advice (medical, legal, veterinary, financial, etc.), or to establish a professional-client relationship. The site and services are provided "as is" with no warranty or representations by JustAnswer regarding the qualifications of Experts. To see what credentials have been verified by a third-party service, please click on the "Verified" symbol in some Experts' profiles. JustAnswer is not intended or designed for EMERGENCY questions which should be directed immediately by telephone or in-person to qualified professionals.

Show MoreShow Less

Ask Your Question

x