Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

1) List and explain the duties of a system administrator.

Linux System Administrator is a person who has ‘root’ access that is ‘superuser’. It
means he has privilege to access everything which includes all user accounts, all
system configurations, home directories with all files therein, all files in system.

Linux System Administrator has following duties (Write any five)

• Installing and configuring server


1. A server is basically a computer program that facilitate the same
computer or other computer by providing services to them.
2. It is most important element of Modern OS and network design.
3. It is of system administrator to configure server so that the most essential
server remain inaccessible. He must be aware of types of attack and
security bugs.
• Installing and configuring application software
1. In order to ensure a correct execution environment, administrator must
provide software which is well configured and validate.
2. He should ensure adequate memory allotment and resolve software
failure and dependency issues.
3. He must provide a set of activities to control hardware and software
configuration and maintain policies for users.
• Creating and maintaining user accounts
1. User can access his own account but administrator has access to every
user account.
2. He can add, modify, delete or copy user account.
3. He is responsible for maintaining security by providing role on a user
account that define the level of access.
• Backing up and restoring files
1. To minimize the loss of data, administrator must maintain backup of files
nd he should restore it whenever required.
2. Administrator can take backup in removable media such as hard drives or
tapes as protection against loss.
3. Before creating backup administrator must decide.
1. What are necessary to backup?
2. How frequently backup should perform.

• Monitoring and tuning performance


1. Monitoring and tuning of performance is essential for Linux to work more
efficiently.
2. Administrator must identify system bottleneck and should solve them.
3. Administrator can use system tools to increase performance, he can
determine when hardware need to be upgrade.
4. He should identify early sign of failure .
• Configuring a secure system
1. It is a duty of administrator to involve tasks and decisions to run secure
Linux system and maintaining data integrity.
2. It provide strong protection to individuals and corporate bodies and
protecting parts of system even if it is under attack.
3. Administrator should ensure
1. System has firewall.
2. Not allow connection from unknown network.
3. Not install software if not needed.

• Using tools to monitor security


1. Linux is the preferred operating system who demands secure networks,
buy it can be easily crack by hackers.
2. It is important for administrator to be aware of tools hackers use and
software used to monitor and counter such activity.
3. It is duty of administrator to prevent unauthorized use of his system.

Explain Bash shell in detail. Answer: BASH SHELL:


ans Explain Bash shell in detail.
Answer:
BASH SHELL:
• Bash stands for Bourne Again Shell and it is the default shell on many Linux distributions.
• The Bash shell is a combination of features from the Bourne Shell and the C Shell.
• It has a command-line editor that allows the use of the cursor keys in a more "user friendly"
manner than the Korn shell.
• It also has a useful help facility allowing you to get a list of commands by typing the first few
letters followed by the "TAB" key known as automatic completion.
• Most used bash feature is history mechanism.
• The default prompt is $
• This shell is located under /bin/bash.
• Command to open this shell is $bash
Useful Bash Key Sequences:
• Ctrl+C Use this key sequence to quit a command that is not responding or taking too long to
complete.
• Ctrl+D This key sequence is used to send the end-of-file (EOF) signal to a command. Use this
when the command is waiting for more input. It will indicate this by displaying the secondary
prompt >.
• Ctrl+R This is the reverse search feature. It opens the reverse-i-search prompt. This feature
helps you locate commands you have used previously.
• Ctrl+Z Some people use Ctrl+Z to stop a command. It does stop the command, but it does not
terminate it. A command that is interrupted with Ctrl+Z is just halted until it is started again with
the fg command as a foreground job or with the bg command as a background job.
• Ctrl+A the Ctrl+A keystroke brings the cursor to the beginning of the current command line.
• Ctrl+Bthe Ctrl+B keystroke moves the cursor to the end of the current command line.
Write short note on Piping and Redirection.
Answer:
• The piping and redirection options are among the most powerful features of the Linux command
line.
• Piping is used to send the result of a command to another command, and redirection sends the
output of a command to a file.
Piping
• The goal of piping is to execute a command and send the output of that command to the next
command so that it can do something with it.
• Example 1:
# ps aux
This command provides a list of all the processes that are currently running on your computer.
a = show processes for all users
u = display the process's user/owner
x = also show processes not attached to a terminal
Pipe ps with less command
# ps aux | less
We can see the complete result page by page
• Example 2:
If we want to check whether a user with the name neha exists in the user database /etc/passwd then
use cat with grep command.
# cat /etc/password | grep neha
Redirection
• Redirection sends the result of a command to a file. This file can be a text file or a device file.
• There are various types of Redirections.
1. Redirecting Output (STDOUT) to a file
2. Using Redirect ion of STDIN
3. Separating STDERR from STDOUT
4. Redirecting Output to device files
5. Cloning Devices Using Output Redirection

With the help of an example, write the steps to mount a device in Linux.

Ans

Example: Mounting a USB Device

1. Open Terminal:
• Open a terminal with root privileges. You can use the sudo command or
log in as the root user.
2. Insert USB Device:
• Insert a USB flash drive into the USB port of your computer.
3. Identify Device Name:
• Use the dmesg command to identify the device name assigned to the USB
flash drive. Assume it is /dev/sdb.
bashCopy code
dmesg | tail
4. Check Partitions:
• Use fdisk to find current partitions on the USB flash drive. Assuming it
has one partition named /dev/sdb1.
bashCopy code
fdisk -l /dev/sdb
5. Mount the USB Device:
• Use the mount command to mount the USB flash drive on the /mnt
directory.
bashCopy code
sudo mount /dev/sdb1 /mnt
6. Navigate to Mounted Directory:
• Change into the mounted directory to access the USB device's contents.
bashCopy code
cd /mnt
7. Verify Contents:
• Use ls to verify that you can see the contents of the USB flash drive.
bashCopy code
ls
8. Navigate Back:
• Use cd without any arguments to return to your home directory.
bashCopy code
cd
9. Unmount the USB Device:
• Use the umount command to try to unmount the USB flash drive.
bashCopy code
sudo umount /dev/sdb1
• Note: If there are any processes still using the device, you might need to
close them before unmounting.

These steps demonstrate how to mount and unmount a USB flash drive in Linux. Always
be cautious when dealing with mounted devices, and ensure that no important data is
being accessed or modified before unmounting.

Give differences between symbolic and Hard Links.


Answer:
• In a Linux file system, we can access a single file from different locations using links.
• Because of this we need not copy files to different locations and make versions.
• A link looks like a regular file, but it’s more like a pointer that exists in one location to show we
how to get to another location.
• In Linux, there are two different types of links. A symbolic link and Hard link

List and explain different File Systems supported by Linux


1. Ext2/3:
• Description: Predecessors of Ext4. Ext2 lacks a file system journal, making
it suitable for very small partitions. Ext3 adds journaling and backward
compatibility with Ext2.
• Advantages: Journaling in Ext3 speeds up recovery after unclean
unmounts.
2. Ext4:
• Description: The default file system on RHEL, a general-purpose file
system with journaling. Journal helps in identifying files open during a
crash.
• Advantages: Improved performance and reliability. Uses disk space for
the journal.
3. XFS:
• Description: Known for good performance in very large file systems and
files.
• Advantages: Optimized for parallel I/O.
4. Btrfs:
•Description: Next-generation Linux file system based on B-tree database.
Features include Copy on Write for easy file versioning.
• Status: Tech preview, not yet ready for production.
5. VFAT and MS-DOS:
• Description: Useful for sharing files on USB drives with Windows users.
6. GFS (Global File System):
• Description: Red Hat's Global File System designed for high availability
clusters, enabling multiple nodes to write to the same file system
simultaneously.

What are Snapshots? Give steps to Manage Snapshot.


In Red Hat Enterprise Linux (RHEL), one commonly used method for creating snapshots
is through Logical Volume Manager (LVM). LVM provides a flexible and powerful way to
manage storage. Here are the steps to manage snapshots in RHEL using LVM:

Managing Snapshots in RHEL with LVM:

1. Identify Logical Volume:

• Determine the logical volume for which you want to create a snapshot. You can
use the lvdisplay command to list existing logical volumes:
bashCopy code
lvdisplay

2. Create a Snapshot:

• Use the lvcreate command to create a snapshot of the identified logical


volume. Specify the size of the snapshot and a name for it. For example:
bashCopy code
lvcreate --snapshot --name snap_name --size size_of_snapshot /dev/vgname/lvname
• Replace snap_name, size_of_snapshot, vgname, and lvname with appropriate
values.
3. Mount the Snapshot:

• Create a mount point and mount the snapshot to access its contents:
bashCopy code
mkdir /mnt/snapshot_mount_point mount /dev/vgname/snap_name /mnt/snapshot_mount_point

4. Perform Operations:

• Use the mounted snapshot for operations such as backup, data recovery, or testing
without affecting the original data.

5. Unmount and Remove Snapshot:

• After completing operations, unmount the snapshot:


bashCopy code
umount /mnt/snapshot_mount_point
• Remove the snapshot:
bashCopy code
lvremove /dev/vgname/snap_name

6. Regular Maintenance:

• Consider regular maintenance tasks such as periodic removal of old snapshots to


manage storage space effectively. You can use the lvremove command to remove
specific snapshots.

Explain group configuration file.


Answer:
There are two group configuration files.
o /etc/group: Group account information.
o /etc/gshadow: Secure group account information.
/etc/group
• To work with groups we must understand group file /etc/group. It has one entry per line, and
each line has the format:
groupname:password:gid:userlist
o groupnameis the name of the group
o passwordis an optional field containing the encrypted group password
o gidis the numeric group ID number
o userlistis a comma-separated list of the user account names that comprise the group
o If x appears in the password field, nonmembers of the group cannot join it using the newgrp
command.
admins:x:507:Maya,sahil,meena
groupname is admins; password is empty, meaning no group password has been set; gid is 503;
and userlist is Maya,sahil,meena.
/etc/gshadow
• The /etc/gshadow file is readable only by the root user and contains an encrypted password for
each group, as well as group membership and administrator information.
• Just as in the /etc/group file, each group's information is on a separate line. Each of these lines is
a colon delimited list including the following information:
o Group name — The name of the group.
o Encrypted password — The encrypted password for the group. If set, non-members of the
group can join the group by typing the password for that group using the newgrp command. If the
value of this field is !, then no user is allowed to access the group using the newgrp command.
o Group administrators — Group members listed here (in a comma delimited list) can add or
remove group members using the gpasswd command.
o Group members — Group members listed here (in a comma delimited list) are regular,
nonadministrative members of the group.

What are file and directory permissions? How to change permissions.


Answer:
• The three basic permissions allow you to read, write, and execute. The effect of these
permissions is different for files and directories.
Files
• The read permission gives you the right to open the fi le for reading.
• The write permission allows you to write/ modify that file.
• Execute permission is required to execute a file. It is never set by default, which makes Linux
almost completely immune to viruses.
Directory
• read allows you to list the contents of that directory. This permission does not allow us to read
files in the directory.
• Write permission allows you to create and remove new subdirectories and files, but we need
execute as well to go down into the directory.
• execute permission indicates that the user can use the cd command to go to that directory.This
permission is required to change to a particular directory or create files in that directory.
Applying Read, Write, and Execute Permissions:
• Use the chmod command to apply permissions.
• We can use this command in two modes: relative and absolute.
• In the absolute mode, three digits are used to set the basic permissions.
• For example, if we want to set read, write, execute for the user, read and execute for the group,
and read and execute for others on the file /somefile, we would use the chmod command
• # chmod 755 /somefile.
• When using chmod this way, all current permissions are replaced by the permissions you set.
• If we want to modify permissions relative to the current permissions, we can use chmod in
relative mode.
• When using chmod in relative mode, you work with three indicators to specify what you want to
do. First you’ll specify for whom you want to change permissions. To do this, you can choose
between user (u), group (g), and others (o).
• Next you use an operator to add or remove permissions from the current mode or set them in an
absolute way.
• At the end, you use r, w, and x to specify the permissions you want to set.
• When changing permissions in relative mode, you may omit the “to whom” part to add or
remove a permission for all entities.
• For example, # chmod +x somefile would add the execute permission for all users
• When working in relative mode, you may use more complex commands as well.
• For example: #chmod g+w,o-rsomefile
• This command add the write permission to the group and remove read for others.

You might also like