OPS435 Assignment 1 - Bash

From CDOT Wiki
Jump to: navigation, search

Due: 19 March (midnight)

Worth: 10%

Late penalties: 10% per day.

Write a script that will run for ever (unless it's killed). Every 5 seconds it will check which users have how many SSH connections open to server where your script is running (you can get this information from the process list). It will display this information in the following format:

Users logged in:
* andrew.smith (can not see home directory) - 2 sessions
* johndoe (can not see home directory) - 1 session
* janesmith (CAN see home directory!) - 1 session

The statement in brackets will communicate to the user whether they can see the contents of the listed user's home directory.

The script may not work great on matrix (becauase it's a cluster, not just one machine) but you should be able to test it on there.

That's all. Make sure you do the work individually, I would recommend that you don't even discuss the assignment among yourselves, so you're not tempted to use someone else's solution.

Submit the script on Blackboard.