0% found this document useful (0 votes)
6 views5 pages

Project Phase1

Operating system project

Uploaded by

njdmh85m8m
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views5 pages

Project Phase1

Operating system project

Uploaded by

njdmh85m8m
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

QATARUNIVERSITY Operating Systems Lab (CMPS 405)

College of Engineering
Dept. of Computer Science & Eng. PBL Project Phase # 1 Fall 2024 Semester

Shell Scripting
Due 31 October 2024

‫ وقد تصل عقوبة ھذه المخالفة فن بعض‬،‫یعد الغش مخالفة أكادیمیة وفقا للوائح والقوانین المعمول بھا فن جامعة قطر‬
‫الحاالتن إىل الفصل النھائن من الجامعة وعىل الطالب تجنب القیام أو المشاركة فن أي عمل یخالف میثاق الناھة االكادیمیة‬
.‫وإجراءات االختبارات المعمول بھا بجامعة قطر‬
Cheating is an academic violation according to Qatar University rules and regulations, and in
some cases, it may result in final dismissal from the University. Students should not under any
circumstances commit or participate in any cheating attempt or any act that violates student
code of conduct.

It is the right of the instructor to test the student’s undersetting of the project in any way during the
demo and discussion session. So, a project that is 100% working might be may be graded (-100%) due
to student not being able to explain a functionality they have implemented.

Project Objectives:

1. Server and Client Configuration on VM environments: Learn the basics of server setup,
including installation of SSH, and SFTP, along with client machine configuration for network
operations.
2. Security and User Authentication: Implement security measures by managing user access and
permissions, ensuring that only authorized users can perform specific tasks.
3. Network Services Automation: Automate common network engineer tasks, including network
configuration checks, system monitoring, and file management through shell scripting.
4. Practical Problem Solving: Apply theoretical knowledge to solve a practical problem faced by
network engineers, emphasizing the automation of repetitive tasks to improve efficiency and
accuracy.

Environment Setup:

• Virtual Machines: Use Ubuntu Desktop or Fedora Workstation for creating three VMs: VM1
(server), VM2 (client), and VM3 (client).
Tasks:
Server Side Tasks (VM1):
Task 1: Setup

1. Server Administrator Tasks (VM1):

- Create local user accounts for each client on the server.


- Install and enable SSHD.
- Configure SFTP for file transfer operations.

Task 2: Configuration

1. Server Configuration (VM1):

• SSH and SFTP Configuration:


o Enable SSH access for clients using local account credentials, that is, configure SSHD server
such that clients can access any file via their local accounts, using username and password.
o Set up SFTP for file uploads/downloads.
o Secure copy will be used to transfer files to and from server.

Task 3: Shell Scripting

• Server Side Shell script 1: (Network.sh)


To ensure proper network connectivity between the one server VM (VM1) and two client VMs
(VM2 and VM3) you setup, now your task is testing connectivity between these machines and
automate pinging from each VM to others.

1. Identify the IP addresses of VM1 (server), VM2 and VM3 (clients).


2. Execute the script: Use `./network.sh "target_IPs"` to test connectivity, using `ping`,
from VM1 to VM2 and VM3, and vice versa. This script must run 3 times in total. A
timeout must be used.
o If the target VM(s) is not responding, run a second script, `traceroute.sh`, which
checks again the connectivity using trace route, and reboots the machine in case the
target cannot be reached. The tractoute.sh script should display the routing table, and
hostname, test your local DNS Server, trace the route to google.com, and finally ping
google.
o All information is saved in a log file (network.log) and displayed on the screen.
o Otherwise, it should show the current date in the following format: "2024-10-14
10:03:04" along with this message "Connectivity with $target_IP is ok".

[Note: if the network tools are not installed in the system, then, your shell script needs
to install first]

• Server Side Shell script 2: (System.sh)


The script will display detailed disk information of your HOME directory including:

o disk space, disk usage for directories, and subdirectories, etc).


o All information is saved in a log file (disk_info.log) and displayed on the screen.

In addition to disk usage, show free and used memory percentage only, CPU Model, and the
number of CPU Cores. Save results in a log file (mem_cpu_info.log).

Client side Tasks (VM2) and (VM3):


Task 1: Setup

2. Client Machine Setup (VM2 and VM3):

o Validate that SSH is installed and enabled (SSH is installed by default on most systems).
o Install an SFTP client.
o Ensure SCP (Secure Copy) is available for file transfers.

Task 2: Configuration

• SSH and SFTP Configuration:


o Ensure that the local user accounts created on the server match the credentials that will be used
for client access.
o Configure SSH access to the server using local account credentials (username and password).
o Set up SFTP and SCP for file upload and download operations to/from the server.

Task 3: Shell Scripting:

Client 1 (VM1)
Client 1 Side Shell script 1 (login.sh): Develop a login script to manage user credentials and perform
the following:

Step 1: Log Invalid Attempts


o Log every invalid attempt to the server, using SSH, with the user's name and timestamp in
`invalid_attempts.log`. A script that receives a username and password then tries to login to
the server using those credentials.
o Limit to 3 attempts before taking further action.

Step 2: Handle Excessive Invalid Attempts

o Upon exceeding the maximum attempts, display "Unauthorized user!".

o Copy `client_timestamp_invalid_attempts.log` using sftp tool to the server.


o Schedule a user logout from the desktop session after 30 seconds.
Client 1 Side Shell script 2: (Check.sh)

Check Script (Check.sh) will search for all files with permission 777, display them on the screen,
and then change them to 700. All work must be saved in a log file (perm_change.log).

Client 2 (VM2)
Client 2 Side Shell script 1: (Search.sh)

Search (Search.sh) will find the files in your account that are larger than 1M. Store results in a
file (bigfile) alon§g with the search date and the number of files found with that size. If the file
(bigfile) is not empty, from your script email (your email address [email protected]) the system
administrator a message about the contents of the bigfile.

Client 2 Side Script Shell script 2: (Clientinfo.sh)


The client should store a new file every hour on VM1 (the server) by using SCP with the
following information:
• Process tree of all currently running processes.
• List of any dead or zombie processes.
• CPU usage related to processes.
• Memory usage of running processes.
• The top 5 resource-consuming processes (based on CPU or memory usage).
The script will gather this information and save it in a file (e.g., process_info.log) on the
client, which is then securely copied to the server (VM1) every hour.

Instructions & Deliverables: Please read carefully


1- In MS-Word document submit the following:
• Cover page includes necessary details of the group members (Student Name, Student ID)
• In a table format, specify each group member tasks and the contribution percentage into
the project.

2- Submit your scripts with the MS-Word document on the Blackboard in one zipped file no later
than the below due date

Due 31 October 2024

Call the Zip file (StuentNAME1_StudentNAME2_StudentNAME3_StudentNAME4)


3- Copying and/or plagiarism (-100%) which includes:
Inappropriate interaction with any other student, outside agency, website, or software that
generates assessment responses.
4- Shell Script should be error free (Errors) (-25%).
5- In case of late submission, (-10%) for each day of delay (Max 3 days delay).
6- A group of three to four students can work on the project.
7- Team members are required to meet regularly for discussion and workload distribution.
8- It is the right of the instructor to use any way of testing the student in the discussion and demo
session, and according to that in some cases (100%) graded project may be down to (-100%)
graded project.
9- Discussion & Demo 50%. + Student Work 50%.

You might also like