0% found this document useful (0 votes)
23 views10 pages

BCSL 063 Assignment

The document contains a series of assignments related to operating system networking management, including shell scripting, remote access policy creation, TCP/IP configuration, user account management in Linux/UNIX, and DNS server configuration in Windows 2000. Each section provides step-by-step instructions for tasks such as writing shell scripts, configuring network settings, and managing user permissions. Additionally, it includes commands for listing users, setting dates, and managing processes in a Linux environment.

Uploaded by

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

BCSL 063 Assignment

The document contains a series of assignments related to operating system networking management, including shell scripting, remote access policy creation, TCP/IP configuration, user account management in Linux/UNIX, and DNS server configuration in Windows 2000. Each section provides step-by-step instructions for tasks such as writing shell scripts, configuring network settings, and managing user permissions. Additionally, it includes commands for listing users, setting dates, and managing processes in a Linux environment.

Uploaded by

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

Enrollment Number: 2252183973

Course Code: BCSL-063


Course Title: Operating System Networking Management Lab
Assignment Number: BCA(VI)/L-063/Assignment/2024-25

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

ANSWER:

 To create shell script file  vim process_details.sh use this command


 It opens the editor
 Press INSERT key in keyboard and you can type the below code

process_details.sh

# Script to display process details for a given PID

# Prompt user for PID


read -p "Enter the PID of the process: " PID

# Check if the PID is valid (numeric)


if ! [[ "$PID" =~ ^[0-9]+$ ]]; then
echo "Error: PID must be a numeric value."
exit 1
fi

# Check if process with that PID exists


if ! ps -p $PID > /dev/null 2>&1; then
echo "No process found with PID $PID"
exit 1
fi

# Display process details


echo "Process details for PID: $PID"
echo "-------------------------------"
ps -p $PID -o pid,ppid,user,cmd,%cpu,%mem,etime

 :wq type and these function saves the file and quite the program
 Make it executable: chmod +x process_info.sh
 Run it: sh process_info.sh and you get the below output

OUTPUT
1
Enrollment Number: 2252183973

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

ANSWER:

Steps: Creating Remote Access Policy

1. Open Routing and Remote Access:


o Go to: Start → Programs → Administrative Tools → Routing and Remote Access
2. Right-click on "Remote Access Policies" and select "New Remote Access Policy..."
3. The Remote Access Policy Wizard opens.
o Name your policy (e.g., "Allow VPN Users").
o Click Next.
4. Set Conditions:
o Add a condition like "Windows-Groups" or "Day-and-Time Restrictions".
o Example: Add users from a security group like VPN_Users.
5. Set Permissions:
o Select "Grant remote access permission".
6. Configure Profile Settings:
o You can configure authentication protocols, IP settings, etc.
7. Click Finish to save the policy.

Change Remote Access Logging Settings in Windows 2000

1. Open Routing and Remote Access console again.


2. Right-click the server name and select Properties.
3. Go to the "Logging" tab.
4. You’ll see options like:
o Log file location
o Log file size
o Fields to log
o Log file rotation (daily, weekly, etc.)

2
Enrollment Number: 2252183973
5. Make your changes, then click OK.

Q2. (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".

ANSWER:

 To create shell script file  vim list_a_files.sh use this command


 It opens the editor
 Press INSERT key in keyboard and you can type the below code

list_a_files.sh

# Prompt user to enter the directory path


read -p "Enter the directory path: " dir

# Check if the directory exists


if [ ! -d "$dir" ]; then
echo "Error: Directory does not exist."
exit 1
fi

echo "Files starting with 'a' or 'A' in directory: $dir"


echo "------------------------------------------------"

# Use a loop to list matching files


for file in "$dir"/[aA]*; do
if [ -f "$file" ]; then
echo "$(basename "$file")"
fi
done

 :wq type and these function saves the file and quite the program
 Make it executable: chmod +x list_a_files.sh
 Run it: sh list_a_files.sh and you get the below output

OUTPUT
3
Enrollment Number: 2252183973

Q2. (b) Install and configure TCP/IP settings in LINUX/UNIX operating system. Explain with step by
step procedure.

ANSWER:

Step 1: Check Your Network Interface Name


Open terminal and run:
ip addr
Look for your active interface (e.g., enp0s3, eth0, or similar).

Step 2: View Current TCP/IP Settings


nmcli device show <interface>

Example:
nmcli device show enp0s3
This shows current IP address, DNS, gateway, etc.

Step 3: Configure a Static IP Address


You can configure a static IP using either nmcli (command line) or by editing configuration files.
sudo nmcli connection modify enp0s3 ipv4.addresses 192.168.1.100/24
sudo nmcli connection modify enp0s3 ipv4.gateway 192.168.1.1
sudo nmcli connection modify enp0s3 ipv4.dns "8.8.8.8 8.8.4.4"
sudo nmcli connection modify enp0s3 ipv4.method manual

Then apply the changes:


sudo nmcli connection down enp0s3 && sudo nmcli connection up enp0s3

Step 4: Verify Configuration


Check IP:
ip a

Check gateway and routing:


ip route

Check DNS:
4
Enrollment Number: 2252183973
cat /etc/resolv.conf
Ping test:
ping 8.8.8.8
ping google.com

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

ANSWER:

Step 1: Create a New User Account


Use the adduser command:
sudo adduser john

Replace john with your desired username.

Step 2: Set the User's Password


sudo passwd john
You'll be prompted to enter and confirm the password.

Step 3: Give the User Sudo (Admin) Privileges


Add the user to the wheel group:
sudo usermod -aG wheel john

Step 4: Verify Sudo Access (Optional)


Switch to the new user:
su - john

Try a sudo command:


sudo whoami

If correctly configured, it should return:


root

Step 5: Confirm Sudo Group is Enabled (Optional)


Make sure sudo is enabled for the wheel group in the sudoers file:
sudo visudo

Ensure the following line is uncommented:


%wheel ALL=(ALL) ALL

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

ANSWER:

Step-by-Step Procedure

Step 1: Open the DNS Management Console


1. Click Start → Programs → Administrative Tools → DNS.
2. The DNS Manager opens.

5
Enrollment Number: 2252183973
Step 2: Create the Root Zone (".")
1. In the DNS console tree, right-click on the server name.
2. Click "New Zone..." to start the New Zone Wizard.
3. Click Next.
4. Select Primary zone and click Next.
5. Choose Store the zone in Active Directory (optional) or keep it as a file.
6. For the zone name, enter just a dot (.) — this represents the root zone.
7. Accept the default zone file name (e.g., . becomes ..dns).
8. Click Next, then Finish.

Step 3: Remove Root Hints


1. In the DNS console, right-click the server name → Properties.
2. Go to the Root Hints tab.
3. Select all root hints listed and click Remove.
4. Click OK.

This ensures the server doesn’t try to reach the actual internet root servers.

Step 4: Restart the DNS Service


To apply changes:
1. Open Services (Start → Run → type services.msc)
2. Locate DNS Server.
3. Right-click and choose Restart.

Step 5: Verify Root Server Functionality


 The server should now respond only with internal DNS responses.
 It won’t attempt to resolve external domains unless you add forwarders or zone delegations.

Q4. (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.

ANSWER:

Step 1: Access the Remote Machine via SSH


Open terminal on your Fedora system:
ssh [email protected]

Step 2: Find and Download the File Using scp


Exit the remote session (if inside):
Exit

Now download a file from the remote system:


scp [email protected]:/home/user/document.txt .

This downloads document.txt to your current local directory.

Step 3: Modify the File Locally


Open the file using a text editor:
nano document.txt

Make your changes and save the file (Ctrl + O, Enter, then Ctrl + X for nano).

6
Enrollment Number: 2252183973
Step 4: Upload the Modified File Back to Remote Machine
scp document.txt [email protected]:/home/user/document.txt
This overwrites the file on the remote machine with your modified version.

Step 5: (Optional) Confirm Upload by SSH


ssh [email protected]
cat document.txt

Q4. (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.

ANSWER:

Step 1: Identify Network Interface Name


nmcli device status
Common names: enp0s3, eth0, etc.

Step 2: Assign Static IP Using nmcli


Assume interface name is enp0s3.
sudo nmcli con mod enp0s3 ipv4.addresses 192.168.1.2/24
sudo nmcli con mod enp0s3 ipv4.gateway 192.168.1.1
sudo nmcli con mod enp0s3 ipv4.dns "8.8.8.8 8.8.4.4"
sudo nmcli con mod enp0s3 ipv4.method manual
sudo nmcli con up enp0s3

This assigns IP 192.168.1.2 to your interface.

Step 3: Bind a Service to Port 446 (Optional)

Example: Run a Simple HTTP Server on Port 446


1. Create a basic HTML file:
echo "Hello from port 446" > index.html
2. Start a Python web server on port 446:
sudo python3 -m http.server 446
Port numbers below 1024 require sudo. Port 446 is >1024, so it’s safe for most users.

Step 4: Open Port 446 in Firewall


sudo firewall-cmd --add-port=446/tcp --permanent
sudo firewall-cmd --reload

Step 5: Verify Configuration


Check IP:
ip a

Check port is open and listening:


sudo ss -tuln | grep 446

Q5. List and execute the following LINUX/UNIX commands:


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

who command: this will list all users currently logged in.

7
Enrollment Number: 2252183973

(b) To print and set the date.

date command prints the present date

Set the date:


sudo date --set="MMDDhhmmYYYY"

8
Enrollment Number: 2252183973
(c) To show the reference and name of the terminal.

tty command shows the name of the terminal you are using (e.g., /dev/pts/0).

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

touch abc command creates a new file name abc

9
Enrollment Number: 2252183973
(e) To kill a process with its PID.

You can find the PID using: ps aux command

Kill command kills the PID kill 6566

10

You might also like