Ezana Daniel Sna... Assignment
Ezana Daniel Sna... Assignment
INDIVIDUAL ASSIGNMENTS
1
Assignment 1: Linux Installation and Operating Environment
1. Linux installation
Steps to Install Ubuntu Linux 12.04 (LTS) along with Windows
Optionally, you can choose to download updates while installing and/or install third party software, such as MP3
support. Be aware, though, that if you select those options, the entire installation process will be longer!
Since we are going to create partitions manually, select Something else, then click Continue. Keep in mind that even if you do not
want to create partitions manually, it is better to select the same option as indicated here. This would insure that the installer will not
overwrite your Windows , which will destroy your data. The assumption here is that sdb will be used just for Ubuntu 12.04, and that
there are no valuable data on it.
Keyboard layout
Select your keyboard layout and UK (English) and Click on “Continue” button.
2
Who are you?
Fill in the fields with your real name, the name of the computer (automatically generated, but can be overwritten), username, and the
password.
Also at this step, there's an option called "Log in automatically." If you check it, you will automatically be logged in to the Ubuntu desktop
without giving the password.
Option"Encryptmyhomefolder," willencryptyourhomefolder.Click onthe"Continue" button to continue...
Now Ubuntu 12.04 LTS (Precise Pangolin) operating system will be installed.
It will take approximately 10-12 minutes (depending on computer's speed), a pop-up window will appear, notifyingyou that the
installation is complete, andyou'll need to restart thecomputer in order to use the newly installed Ubuntu operating system. Click the
"Restart Now" button.
Pleaseremove the CD andpressthe "Enter" keytoreboot.The computerwillberestarted. In afew seconds,
you should see Windows 7′s boot menu with two entrieslisted – Windows 7 and Ubuntu 12.04 (LTS). Thenyoumaychooseto
bootintoWindows7orUbuntu12.04usingtheUP/Downarrowkey.
Please select Ubuntu 12.04 (LTS) and press Enter to boot the machine inUbuntu 12.04 Linux.
Here you can see the users on the machine, Click on the user name and enter the password and press Enter keytologin.
We have successfully install and login to Ubuntu 12.
3
2. Creating users
In Linux, creating a user involves using the useradd command. Here's the basic syntax for creating a
user:
User groups are collections of users who share certain permissions. You can create a group with the
groupadd command:
1
5. Important files and directories in Linux and their use
Linux has a well-organized file system with directories serving specific purposes.
/(Root Directory): The top-level directory that contains all other directories and files. It's the
starting point of the Linux file system.
/bin: Contains essential binary executables, like basic commands (ls, cp, mv) needed for the
system to function.
/etc: Stores system configuration files, such as password (user account information) and f stab
(file system mount points).
/home: Contains personal directories for each user, where they can store their files and settings.
/var: Holds variable data like logs (/var/log), mail, and temporary files that change over time.
/usr: Houses user-installed software and libraries. Sub-directories include /usr/bin for user
binaries and /usr/lib for libraries.
/dev: Contains device files that represent hardware components, like hard drives (/dev/sda) and
USB devices.
/tmp: A temporary directory for files that are automatically deleted after a reboot.
/proc and /sys: Virtual file systems providing information about system processes and hardware
To install Apache Tomcat, download the latest version from the official website.
cd /opt/tomcat/bin
sudo ./startup.sh
To stop Tomcat: sudo ./shutdown.sh
2
7. Configuring database using PostgreSQl
I, Install postgresql
II.Starting postgresql
? Self-study questions
I) BIOS/UEFI Initialization: The system's BIOS (Basic Input/Output System) or UEFI (Unified
Extensible Firmware Interface) initializes hardware components and performs the POST (Power-On
Self-Test).Once completed, it locates and loads the boot loader into memory from the configured boot
device.
3
II) Bootloader (e.g., GRUB, LILO): The boot loader is responsible for loading the Linux kernel into
memory.It provides a user interface to select which kernel or operating system to boot, if multiple are
available.
Example: GRUB (GR and Unified Boot loader) is commonly used in Linux distributions
III) Kernel Initialization: The Linux kernel is loaded into memory and begins execution. It
initializes system hardware and mounts the root file system (typically in read-only mode initially)
IV) initramfs/initrd (Initial RAM Disk): A temporary root file system (initramfs or initrd) is loaded
to facilitate the kernel in mounting the actual root file system.It contains necessary drivers and utilities
needed to access the root file system.
V) init System: After mounting the root filesystem, the kernel hands over control to the init system (or
its alternatives like systemd, Upstart, etc.).This process is responsible for managing system processes
and setting up the required environment.
VI) Runlevel/Target Execution: The init system executes scripts and services according to the
runlevel (traditional init) or target (systemd) defined in its configuration. These run levels/targets
determine what state the system will enter (e.g., single-user mode, multi-user mode, or graphical
interface).
VII) bLogin Prompt: Once the boot process is complete, the system provides a login prompt for
the user, either through a command line (CLI) or graphical user interface (GUI).
A run level in Linux refers to a predefined state of the system that determines which services and
processes are running. It is used to control the system's operational mode, such as whether it operates
in single-user mode, multi-user mode, or graphical mode.
This bellows are the predefined run levels in traditional SysVinit systems:
Run Level 3: Full multi-user mode with networking (text-based, commonly used on servers).
Run Level 5: Multi-user mode with a graphical interface (GUI, used on desktops).
4
3. Find out the run level of your computer
The run level of my computer is N5 this implies the current runlevel is 5 (graphical mode).
· NIS (Network Information Service): NIS is a client-server directory service protocol designed
to distribute system configuration data, such as user accounts, hostnames, and group information,
across a network.
It allows multiple machines within an NIS domain to share a common set of configuration files,
simplifying system administration.Originally developed by Sun Microsystems, NIS is supported
by most Unix-based systems.
NFS (Network File System): NFS is a distributed file system protocol that enables a computer to
access files over a network as if they were on its local disk.
It uses a client-server architecture, where the server exports file systems, and clients mount them
for local use.
NFS is widely used for sharing files between Unix/Linux systems and even non-Unix systems like
Windows and macOS.
Example use: Sharing home directories or project files across multiple systems
5
6. What is the use of RPM? List various options of rpm
command with syntax
RPM (Red Hat Package Manager) is a powerful command-line tool used in Linux systems,
especially Red Hat-based distributions like Fedora, CentOS, and RHEL. It is designed for managing
software packages in .rpm format. With RPM, you can install, update, query, verify, and remove
software packages.
Syntaxs of RPM:
Install a package:
rpm -i [package_name]
Upgrade a package:
rpm -U [package_name]
Remove a package:
rpm -e [package_name]
Query a package:
rpm -q [package_name]
Verify a package:
6
rpm -V [package_name]
Check dependencies:
Force installation:
Test installation:
/home:
Contains personal directories for each user on the system. and Stores user-specific files,
configurations, and data.
/boot:
Holds files required for booting the system, such as the kernel and boot-loader configuration files.
/dev:
Contains device files that represent hardware devices (e.g., /dev/sda for a hard drive).
/usr:
Stores user-installed software, libraries, and documentation. and the Sub-directories include
/usr/bin for binaries and /usr/lib for libraries.
/mnt:
7
A temporary mount point for attaching file-systems (e.g., USB drives or network shares).
/media:
Used for mounting removable media like CDs, DVDs, and USB drives.
/etc:
Contains system-wide configuration files and scripts (e.g., network settings, user accounts).
/bin:
Stores essential binaries (commands) needed for basic system operation (e.g., ls, cp).
/usr/bin:
/etc/fstab:
A configuration file that defines how and where file-systems are mounted at boot.
.bashrc:
It is a hidden file in a user’s home directory. it Contains user-specific shell configurations and
aliases for the Bash shell.
8
Assignment 2 : Networking Commands in Linux
1. ping
Output:
ping localhost
Output:
9
ping <other-ip-in-network>
Output:
2. hostname
Output:
3. traceroute
traceroute ip-address
Out put:
10
4. netstat
$netstat
Out put:
Netstat -t
Output:
netstat –s –t
Output:
11
netsta t -I
Output:
5. Ifconfig
ifconfig is used for displaying network interface information.
Output
12
6 .who :- Displays information of all users who are logged in
Output:
7. whoami
The whoami command writes the user name (i.e., login name) of the owner of the current login
session to standard output.
Output:
8. Nmap
Network mapper tool to discover hosts and services on a computer network.
Output
13
9. Tcpdump
Tcpdump prints out a description of the contents of packets on a network interface that match the
boolean expression; the description is preceded by a time stamp, printed, by default, as hours, minutes,
seconds, and fractions of a second since midnight.
Output:
14