0% found this document useful (0 votes)
375 views14 pages

BCSL-063 Solved Assignment 2024-25

Uploaded by

Himanshu chauhan
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)
375 views14 pages

BCSL-063 Solved Assignment 2024-25

Uploaded by

Himanshu chauhan
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/ 14

Course Code : BCSL-063

Course Title : Operating System Networking Management Lab

Assignment Number : BCA(VI)/L-063/Assignment/2024-25

Maximum Marks : 50

Weightage : 25%

Last date of Submission : 31st October, 2024 (For July, Session) : 30th April, 2025 (For

January, Session)

Note:

Answer all the questions in the assignment having 40 marks in total. 10 marks are for viva
voce. You may use illustrations and diagrams to enhance the explanations. Please go
through the guidelines regarding assignments given in the Programme Guide for the format
of presentation. Make suitable assumption if necessary.

Q1. (8 Marks)

(a) Write a shell script which will accept the PID of a process and display the details of
that process.

(b)Create Remote Access Policy. Show how you can change to Remote Access Logging
setting in Windows 2000.

Solution:

(a) Shell Script to Display Process Details:

#!/bin/bash

# Check if a PID is provided as an argument


if [ -z "$1" ]; then
echo "Usage: $0 <PID>"
exit 1
fi

# Check if the PID is a valid number


if ! [[ "$1" =~ ^[0-9]+$ ]]; then
echo "Invalid PID: $1"
exit 1
fi

# Check if the process exists


if ! ps -p "$1" > /dev/null; then
echo "Process with PID $1 not found."
exit 1
fi

# Get process details using ps command


ps -p "$1" -o pid,ppid,user,%cpu,%mem,vsz,rss,tty,stat,start,time,cmd

Screenshot:
(b) Remote Access Policy and Logging in Windows 2000:

Creating a Remote Access Policy:

1. Open the Remote Access Policy: In Windows 2000, go to Start -> Programs ->
Administrative Tools -> Remote Access Policy.
2. Create a New Policy: In the Remote Access Policy snap-in, right-click on "Remote
Access Policies" and select "New". Give the new policy a descriptive name.
3. Configure Permissions: Within the new policy, configure the permissions for various
users or groups. This involves defining which users can connect remotely, what
authentication methods are allowed, and what network resources they can access.

Changing Remote Access Logging Settings:

1. Open the Remote Access Service Properties: In Windows 2000, go to Start ->
Settings -> Control Panel -> Administrative Tools -> Services. Find "Remote Access
Connection", right-click it and select "Properties".
2. Navigate to the Logging Tab: In the Remote Access Connection Properties window,
navigate to the "Logging" tab.
3. Configure Logging Options:
o Enable logging: Check the "Enable logging" box.
o Choose Logging Level: Select the desired logging level (e.g., Detailed, Basic).
o Specify Log File Location: Indicate the directory where the log files should be
stored.
4. Apply Changes and Restart Service: Click "Apply" and then "OK" to save changes.
Restart the Remote Access service for the modifications to take effect.

Q2. (8 Marks)

(a) Write a shell program to scan all the files in a particular directory and list only those
files which start (file_name) with "a" or "A".
(b)Install and configure TCP/IP settings in LINUX/UNIX operating system.Explain with
step by step procedure.

Solution:

(a) Shell Program to Scan Files Starting with "a" or "A":

#!/bin/bash

# Check if a directory is provided as an argument


if [ -z "$1" ]; then
echo "Usage: $0 <directory>"
exit 1
fi

# Check if the provided argument is a valid directory


if [ ! -d "$1" ]; then
echo "Invalid directory. Please provide a valid directory path."
exit 1
fi

# Scan the directory and list files starting with 'a' or 'A'
find "$1" -maxdepth 1 -type f -name "[aA]*" -print

(b) Installing and Configuring TCP/IP Settings in Linux/Unix:

Step-by-Step Procedure:

1. Verify Network Interface:


o Determine the name of the network interface (e.g., eth0, enp0s3).
o Use ifconfig or ip a to check the available interfaces.
2. Configure IP Address, Netmask, and Gateway:
o Edit the network configuration file:
 For Debian/Ubuntu based systems, use nano /etc/netplan/01-network-
manager-all.yaml (or other files in the /etc/netplan/ directory)
 For Red Hat/CentOS based systems, use nano /etc/sysconfig/network-
scripts/ifcfg-eth0 (replace eth0 with your interface name).
o Update the following settings as per your network requirements:
 address: IP address of the interface.
 netmask: Network mask for the interface.
 gateway4: Default gateway for IPv4 traffic.
 Save the file and exit the editor.
3. Configure Nameserver (DNS):
o Edit the /etc/resolv.conf file.
o Add the DNS server addresses:

nameserver 8.8.8.8
nameserver 8.8.4.4

o Save the file and exit the editor.

4. Restart Networking Service:


o Apply the changes to the network configuration:
 For systems using netplan: sudo netplan apply
 For systems using /etc/sysconfig/network-scripts/: sudo systemctl
restart network or sudo service network restart.
5. Verify TCP/IP Configuration:
o Use ip a to check if the IP address and other settings are correctly applied.
o Use ping to test connectivity to other hosts (e.g., ping google.com).
6. Optional: Configure Hostname:
o Edit the /etc/hostname file and update the desired hostname.
o Edit the /etc/hosts file and add an entry for the hostname.
Q3. (8 Marks)

(a) Create a user account in the LINUX/UNIX Server. Set its password and define its
permission like'an administrator.

(b)Configure a DNS Server as a Root Name Server in Windows 2000 Server. Explain with
step by step procedure.

Solution:

(a) Creating a User Account with Administrator Privileges in Linux/Unix

To create a user account with administrator privileges in a Linux/Unix server, I would follow
these steps:

1. Creating the User Account:

useradd -m newuser

This command creates a new user named "newuser" and also creates a home directory for
them.

2. Setting the Password:

passwd newuser

This command prompts me to set a password for the newly created user. I will enter and
confirm the password.

3. Granting Administrator Privileges (sudo access):


There are several ways to grant administrator privileges in Linux/Unix systems, but
the most common method is using the sudo command.
o Adding to the 'sudo' group:

usermod -aG sudo newuser


This command adds the "newuser" to the "sudo" group, which provides them with the
ability to execute commands with elevated privileges.

(b) Configuring a DNS Server as a Root Name Server in Windows 2000 Server

To configure a DNS Server as a Root Name Server in Windows 2000 Server, I would follow
these steps:

1. Open DNS Management Console:


I would open the DNS management console by navigating to Start -> Programs ->
Administrative Tools -> DNS.
2. Create Forward Lookup Zones:
In the DNS console, I would right-click on the server name and select "New Zone..."
Then, I would select "Primary Zone" and click Next.
I would then enter the name of the zone, for example, ". (Root)" and choose "Allow
dynamic updates" (if needed).
3. Create Reverse Lookup Zones:
Similar to forward lookup zones, I would create a reverse lookup zone for the root
domain. This is also a primary zone and in the name field, we would use "0.0.127.in-
addr.arpa" or 0.in-addr.arpa". I would select "Allow dynamic updates" (if needed).
4. Add Root Hints:
I need to add a few root servers as hints to the DNS server so it can access the root
zone.
o Open the DNS Manager console.
o Select the Forward Lookup Zone of the root server.
o Right-click and choose "New..." then select "Host (A or AAAA)".
o Set the values according to root server details. For example:
o Name : a.root-servers.net
o IP: 198.41.0.4
o Name : b.root-servers.net
o IP: 192.228.79.201
o Name : c.root-servers.net
o IP: 192.33.4.12
o etc.
5. Configure Zone Transfers (Optional):
If it is desired for other DNS servers to receive updates on the root zone, I would
configure zone transfers.
6. Restart the DNS Server:
I would restart the DNS server to apply the changes.

Q4. (8 Marks)

(a) In LINUX/UNIX system, access your account available at a remote machine.


Download a file from the remote location, modify that file and upload back to the
remote machine.

(b)Configure TCP/IP setting in LINUX/UNIX. Assume IP address is 192.168.1.2 and Port


is 446.Explain with step by step procedure.

Solution:

(a) Accessing a Remote Machine, Downloading, Modifying, and Uploading a File in


LINUX/UNIX

To access my account on a remote machine, download a file, modify it, and upload it back, I
would utilize the Secure Copy (SCP) and Secure Shell (SSH) protocols. Here's a step-by-step
procedure:

1. Establish a Secure Shell (SSH) connection to the remote machine:

ssh username@remote_machine_IP_address

Replace username with my username on the remote machine and


remote_machine_IP_address with the remote machine's IP address.

2. Download the file from the remote machine:


scp username@remote_machine_IP_address:/path/to/remote/file
/path/to/local/destination

Replace /path/to/remote/file with the full path to the file on the remote machine and
/path/to/local/destination with the desired local destination path.

3. Modify the downloaded file:


I would use a suitable text editor (like nano, vim, or gedit) to modify the content of
the downloaded file.
4. Upload the modified file back to the remote machine:

scp /path/to/local/modified/file
username@remote_machine_IP_address:/path/to/remote/destination

Replace /path/to/local/modified/file with the path to the locally modified file and
/path/to/remote/destination with the desired destination path on the remote
machine.

(b) Configuring TCP/IP Settings in LINUX/UNIX with IP Address 192.168.1.2 and Port
446

To configure TCP/IP settings in LINUX/UNIX with the given IP address and port, I would
typically modify the network interface configuration files. The exact procedure might vary
slightly based on the specific Linux distribution. Here's a general guideline:

1. Open the network interface configuration file:


This file is usually named /etc/sysconfig/network-scripts/ifcfg-eth0 or a similar name
based on the network interface (e.g., eth1, wlan0). If it doesn't exist, create a new file
with the appropriate name.
2. Set the IP address and netmask:

IPADDR=192.168.1.2
NETMASK=255.255.255.0
Replace the values if needed.

3. Set the gateway (if applicable):

GATEWAY=192.168.1.1

Replace with your gateway IP address.

4. Configure the port (if specific to a service):


If port 446 needs to be explicitly configured for a specific service, that service's
configuration file would be modified to use this port. For example, if it's for an SSH
server, the SSH configuration file (e.g., /etc/ssh/sshd_config) might contain a line like
Port 446.
5. Restart the networking service:

sudo systemctl restart network

This command will reload the network configuration and apply the changes.

6. Verify the changes:

ip addr show

This command will display the network interface configuration, including the assigned IP
address.

Q5. List and execute the following LINUX/UNIX commands: (8 Marks)

(a) To list all the current users logged in the system.

(b) To print and set the date.


(c) To show the reference and name of the terminal.

(d) To create a new file with name "abc" in the current directory.

(e) To kill a process with its PID.

Solution:

(a) List all current users logged in the system:

Command:

who

Explanation:
The who command displays a list of all users currently logged into the system, including
their username, terminal, login time, and idle time.

(b) Print and set the date:

Print the current date:

date
Set the date:

sudo date --set="MMDDhhmmYYYY"

Replace MMDDhhmmYYYY with the desired date and time in the format
MonthDayHourMinuteYear.
For example, sudo date --set="031510302023" would set the date to March 15, 2023, 10:30
AM.
Note: sudo is required as setting the system date usually requires root privileges.

(c) Show the reference and name of the terminal:

Command:
tty

Explanation:
The tty command displays the file name associated with the current terminal. This gives the
reference and name of the terminal.

(d) Create a new file named "abc" in the current directory:

Command:

touch abc
Explanation:
The touch command creates an empty file with the specified name, "abc", in the current
working directory.

You might also like