0% found this document useful (0 votes)
10 views3 pages

Experiment No11

Ohocph ph oyho

Uploaded by

aatifdjhs80
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)
10 views3 pages

Experiment No11

Ohocph ph oyho

Uploaded by

aatifdjhs80
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/ 3

Experiment No.

7: Creating and Managing a Root User in Linux


Aim: To create a root user in Linux, manage its permissions, and explore
security precautions necessary to safeguard the system from unauthorized
access.
Theory:
• Root User: In Linux, the root user (superuser) has unlimited control over
the system, including access to all files, commands, and system
resources. The power of the root account makes it essential to manage
carefully to avoid potential security risks.
• Properly configuring root access and managing permissions helps
prevent unauthorized users from gaining control of the system, ensuring
its integrity and security.
Conclusion: The experiment demonstrated how to create and manage a
root user in Linux while emphasizing the importance of securing this
privileged account to protect the system from security vulnerabilities
(EXP NO 7).
Experiment No. 8: Configuring TCP/IP in Linux
Aim: To manually configure a static IP address, subnet mask, and default
gateway in Linux, and to understand how these configurations impact network
connectivity.
Theory:
• IP Address: A unique identifier assigned to each device on the network
to enable communication.
• Subnet Mask: Helps determine the range of valid IP addresses within a
network by dividing the network and host portions of the IP address.
• Default Gateway: Acts as the router that sends network traffic from the
local machine to external networks, like the internet.
Procedure:
1. Identify Network Interfaces: Use ip addr to list all active network
interfaces and select the appropriate one (e.g., eth0 or wlan0).
2. Configure Static IP: In Ubuntu/Debian, edit the /etc/netplan/01-
netcfg.yaml file, specifying the desired IP address, subnet mask, default
gateway, and DNS servers.
3. Apply the Configuration: Use sudo netplan apply to activate the
changes.
4. Verify Configuration: Check the network setup by using ip addr and ip
route to view IP and routing settings, and ping to confirm connectivity.
Results: After applying the configuration, the machine should have a
static IP address. Successful ping responses indicate that the device is
properly configured for external network access. Conclusion: This
experiment successfully demonstrated how to configure TCP/IP settings
manually in Linux, ensuring reliable and stable network connectivity(EXP
NO 8)
Experiment No. 9: Executing Basic Networking Commands in Linux
Aim: To gain familiarity with fundamental networking commands in Linux for
managing network configurations and diagnosing connectivity issues.
Theory: In Linux, networking is managed using various command-line tools that
allow users to check network configurations, test connectivity, resolve domain
names, and monitor active connections. Some essential commands include:
• ifconfig: For displaying or configuring network interfaces.
• ip: A modern replacement for ifconfig, which also handles network
settings.
• ping: Sends ICMP packets to test connectivity with another host.
• netstat: Shows network statistics, including routing tables and open
sockets.
• traceroute: Displays the path that packets follow to reach a destination.
• nslookup: Resolves domain names to IP addresses.
Procedure:
1. Check Network Interfaces: Use ifconfig or ip a to view details such as IP
addresses and network statuses.
2. Test Connectivity: Use ping to verify if a remote server (like google.com)
is reachable.
3. Check Routing Tables: Use netstat -r or ip route show to display how
network packets are routed.
4. Trace Network Path: Use traceroute to trace the route taken by packets
to a specified destination.
5. DNS Resolution: Use nslookup to translate domain names into IP
addresses.
6. View Active Connections: Use netstat -tuln to check open TCP and UDP
ports. Conclusion: Through these commands, users can efficiently
monitor, troubleshoot, and configure network settings in Linux(EXP NO
9)

Experiment No: 10 - Shell Script to Find Factorial of a Given Number


This experiment focuses on writing a shell script that calculates the factorial of
a number entered by the user. The script uses a for loop to multiply the
numbers from 1 to the input number. The procedure involves creating and
executing a shell script (factorial.sh) which prompts the user for a number and
displays the factorial result. The script demonstrates basic shell scripting
concepts and control structures in Linux(EXP NO 10).

Experiment No: 11 - Shell Script to Display a Pattern Using Nested Loops


In this experiment, a shell script is written to print a simple right-angle triangle
pattern using nested loops. The outer loop controls the number of rows, and
the inner loop controls how many symbols (e.g., asterisks) are printed per row.
The user inputs the number of rows, and the script (pattern.sh) prints the
corresponding pattern. This experiment demonstrates the use of nested loops
in shell scripting to create visual patterns(EXP NO 11).

Experiment No: 12 - Shell Script to List All Files in a Directory


This experiment involves creating a shell script that lists all files in a specified
directory. The script asks the user to enter a directory path and uses the ls
command to list the files. If no directory is entered, it lists the files in the
current working directory. The script (list_files.sh) helps automate the process
of listing files and demonstrates the basic use of conditional statements and
input/output operations in shell scripting(EXP NO 12).

You might also like