25 pts - Linux Command Line Q&A
Visit this course in D2L and complete Quiz02 by the due date / time for this assignment. Note that you will have 15 questions each worth 2 pts so there is a bonus opportunity of up to 5 pts.
(25 pts) Scripting 'Old School'
Ref: (Video) Quick course in 'old school' scripting
Ref: (Text file) Example Linux bash script
Ref: (Text file) Example Windows bat script
Linux Version
Using your xxxxLS1 VM install this
text file as TP02.sh in your (admin login) home
folder (not Documents). This bash script accepts exactly one parameter
which is the name of the directory within Documents (of whichever user
is running the script) to use for (re)creating a file named NewStuff.txt
with some text. From your home folder, execute the script using sh
TP02.sh Dir4TP02
capturing the results in a screen cap named
SOS1LS.jpg (or other image format).
Based on the example script create a new bash script TP02a.sh
which accepts two parameters: the first is the directory name as before and the second
is the file name (instead of always NewFile.txt) to (re)create. From your own login
in your home folder execute the script using sh TP02a.sh Dir4TP02a
Demo.txt
capturing the results in a screen cap named
SOS2LS.jpg.
Copy TP02a.sh to TP02ash.txt (so it can be uploaded in D2L). Attach the two screen caps and TP02ash.txt to this assignment in D2L.
Windows Version
Using your xxxxWS1 VM install this
text file as TP02.bat in your (admin login) home
folder (not Documents). This bat script accepts exactly one parameter
which is the name of the directory within Documents (of whichever user
is running the script) to use for (re)creating a file named NewStuff.txt
with some text. From your home folder, execute the script using TP02 Dir4TP02
capturing the results in a screen cap named
SOS1WS.jpg (or other image format).
Based on the example script create a new bat script TP02a.bat
which accepts two parameters: the first is the directory name as before and the second
is the file name (instead of always NewFile.txt) to (re)create. From your own login
in your home folder execute the script using TP02a Dir4TP02a Demo.txt
capturing the results in a screen cap named
SOS2WS.jpg.
Copy TP02a.bat to TP02abat.txt (so it can be uploaded in D2L). Attach the two screen caps and TP02abat.txt to this assignment in D2L.
(25 pts) A look at environment variables
Ref: (Video) Environment variables intro
Ref: (Files) MyDir.bat (for Windows) and MyDir.sh (for Linux)
Develop a Word document named EnvironmentVariables101.docx. In paragraph one describe what environment variables are and briefly how an operating system, sys admins, and developers use them. In a second paragraph report the value of the HOME (Linux) and HOMEPATH (Windows) environment variables and describe what this variable value is providing. Include a third paragraph describing the PATH environment variable (used by both Linux and Windows); not its value but what it is used for.
Complete the following tasks in your VMs adding screen caps as indicated to your document.
MyDir.bat
). The result should show where the script actually ran from; add a screen cap
of your command and the result to your document.bash MyDir.sh
). The result should show where the script actually ran from; add a screen cap
of your command and the result to your document.Attach your completed document to this assignment in D2L.
(25 pts) Configuring & using remote access
Windows Remote Desktop
Ref: (Article) Enable Remote Desktop
Ref: (Video) Configuring Windows Remote Desktop | Notes
Addendum: In the video I ping my Windows server VM. Ping isn't required to setup Remote Desktop but to ping a Windows computer, some modifications to the server's firewall are needed. Visit Configure Windows Server to Respond to ping for guidance on setting this up if you are interested.
Refs for connecting via RDP: (Videos) using remote desktop client from a Windows PC and using remote desktop client from a Mac
Do the following in your xxxxWS1 Windows Server VM from your admin login:
From your host computer (while the VM is running) access your VM as ruser via a RDP client. Leave this session alive as you try to access your VM as tuser via a RDP client.
Return to your Windows Server VM as admin and execute the following commands in a PowerShell console (you may want to verify that the event-log shows a failure for tuser to login and a success for ruser and query user shows your admin login and ruser as active):
Get-Date | Out-File .\DemoRDP.txt
$env:ComputerName | Out-File .\DemoRDP.txt -Append
$env:UserName | Out-File .\DemoRDP.txt -Append
Get-EventLog -LogName Security | `
Where-Object {$_.Message.contains("tuser") -or $_.Message.contains("ruser")} | `
Select-Object -Property TimeGenerated -ExpandProperty Message -first 20 | `
Out-File .\DemoRDP.txt -Append
query user /server:$SERVER | Out-File .\DemoRDP.txt -Append
Attach DemoRDP.txt to this assignment in D2L
Linux Secure Shell
Ref: (Article) Enabling SSH in Ubuntu
Ref: (Video) Configuring Linux Secure Shell | Notes
Ref for connecting via SSH: (Article) How to Connect to an SSH Server from Windows, macOS, or Linux but note that Windows 10 now includes an SSH client so SSH can be used (as with connecting from Linux or a Mac) rather than using PuTTy.
Do the following in your local VMware Linux VM from your admin login:
From your host computer (while the VM is running) access your VM as ruser via a SSH client. Leave this session alive as you try to access your VM as tuser via a SSH client.
Return to your Linux VM as admin and execute the following commands in terminal (you may want to verify that the auth.log shows a failure for tuser to login and a success for ruser and w shows your admin login and ruser as active):
date > DemoSSH.txt
hostname >> DemoSSH.txt
whoami >> DemoSSH.txt
tail /var/log/auth.log >> DemoSSH.txt
w >> DemoSSH.txt
Attach DemoSSH.txt to this assignment in D2L.
(25 pts) User Policies 101
Setting User Policies
Ref: No video demo but something you should be able to accomplish from brief Server Policies 101 Notes and the readings for review from the agenda
In your xxxxWS1 VM set the following policies for the computer and in your xxxxLS1 VM set them for the user tuser created in an earlier exercise. Policies should require
After setting policies
date
|
hostname
| whoami
| net accounts
(from the cmd console or Windows Powershell) and create a
screen cap named WS1Pol.jpg of the results.date
| hostname
|
whoami
| sudo chage -l tuser
in a terminal creating
a screen cap named LS1Pol.jpg with the results.Attach the two image files to this assignment in D2L
Password Policy Document
Refs: A Free Password Policy Template | Password policy recommendations (Microsoft)
Using (recommended) the template document from A Free Password Policy Template as a starting point develop a Word document named PasswordPolicy.docx proposes your guidelines for password policies in your company named AIST3720 OS & Sys Admin, Inc. Your document needs to include 3 references cited at the end of your policy (the two above can be used so find at least one more reference). For each point of your policy (e.g., the template's numbered items in Password Creation, Password Aging, and Password Protection) add a sentence or two with a rationale and identify which reference(s) support your policy.
You will end up with maybe 1.5 to 2 pages single-spaced do if you are headed beyond that then pare back a bit. The important aspects are a clear policy and rationale along with a cited reference, not so much agreeing with some 'book answer' only the instructor has. Attach your completed document to this assignment in D2L.