itis 3110 lab 02 scripts i. lab ids your lab id is the same as your 49er id the pw is different: a +...

Post on 31-Dec-2015

219 Views

Category:

Documents

7 Downloads

Preview:

Click to see full reader

TRANSCRIPT

ITIS 3110LAB 02

Scripts I

Lab IDs• Your Lab ID is the same as your 49er ID• The PW is different:

• a + your 800 id• a800123456

• Note: sometimes the a is not required

• Change the password ASAP• passwd• Follow the instructions

Scripts I and II• Two parts to this lab:

• Scripts I (due next week)• Entering simple scripts• Testing • Documenting• Simple modifications on some

• Scripts II (last half of semester)• Writing your own

• Major improvements to addpermplus• Create new accounts

Make life easy hint:• Start writing your own scripts to make running and

maintenance of your VMs easier• Example

• Create two network interfaces templates• One for DHCP• One for a specific address

• Write a script to:• Stop the network• Copy a template to replace the current interfaces record• Start the network

• Once written and debugged changing configurations will be a quick error free task

Scripts II• Suggest:

• Review Scripts I and II requirements• Complete Scripts I this lab period• Between Scripts I and II:

• Review what the individual exercises showed in Scripts I• Review the requirements for the two Scripts II parts• Many of the mini-scripts in Scripts I can be used in Scripts II• Have the code ready to type in Scripts II

SCRIPTS I HINTS Stage 1

Scripts• Read the instructions carefully!

• If you type in the examples verbatim many of them WILL NOT work!

• Understand and follow the steps in “Getting Started” or you will suffer pain doing the lab.

• Many of the scripts in the exercise can be use for parts of Scripts II• Scan what is needed for Scripts II• Keep those requirements in mind as you do Scripts I

• Note what you may reuse or modify to do Scripts II

Deliverables• Scripts I

• Documentation showing working and non-working scripts as appropriate• Show code being tested and the results• Important:

• Show incorrect data is properly rejected (if appropriate)• E.g. wrong length PWs

• Show correct data accepted (as appropriate)

• Copy of the Lab with comments (optional)• What worked• Typos• Comments on what was instructional and what wasn't and why

• Estimate of amount of time spent on lab

• Upload to Moodle• .doc file

Warning• MS Office has decided it doesn’t like spaces

• Some of the spaces between words has been eliminated• Most (hope all) have been replaced

• Most occurred between font style changes

• Let the instructor know if you find a missing one

SCRIPTS II HINTS

Improve addpermplus.sh• 1st parm must be only u, g, o, or a• 2nd parm must be only r, w, or x• 3rd parm must be a valid name

• You decide what are your requirements for a valid name:• size• characters• anything else

• Document your choice• Why these requirements

• Test and document it's working• Show proper passes & rejections

Create new accounts• Source for the new IDs will be an Excel file

• Contains firstname and lastname

• Convert (save) Excel .xls .csv file• Read the csv file to generate usernames

• Up to first 6 character of lastname last• 2 characters of firstname first• Concatenate last + first for the username

• Create an account for each user• Home directory• Assign a random pw

• Your choice for length (but at least 6 chars)• Your choice for chars (but at least 1 alpha and 1 numeric)• Record the pw somewhere so it can be sent to the user

• Recommend creating a new .csv file with the first name, last name, user name and pw• Can be viewed with a text reader or spreadsheet

• Force new PW when 1st login

Random Password• Use Google to find simple script• If you have openssh installed it is a simple one-liner

Deliverables• Scripts II

• Document results of running the code• Before • After

• Estimate of amount of time spent on lab

• Upload to Moodle• .doc file for report• Enhanced addpermplus code• New accounts code

• You might not get this lab back• Since this is the second time for this lab it may be liberally

graded

Last hints• sh

• Bourne shell

• bash• Bourne again (bash) shell

• The systax between them is very similar• Some script code will work in either• Some script code will work differently depending on the shell

• Make sure you are running the right shell when you script is executed

GET STARTED

top related