Unix/Linux System Administration Final Exam Review

¡Supera tus tareas y exámenes ahora con Quizwiz!

How can you start and stop Apache (httpd) without shutting the system down?

$ sudo systemctl start apache2 $ sudo systemctl stop apache2

RPM(s)

(Red Hat Package Manager) is an default open source and most popular package management utility for Red Hat based systems like (RHEL, CentOS and Fedora). The tool allows system administrators and users to install, update, uninstall, query, verify and manage system software packages in Unix/Linux operating systems.

tarballs

A tarball or tarfile is name of group or archive of files that are bundled together using the tar command. They usually have the . tar file extension.

User Applications

Normal applications that are in the user space that we use everyday. Like Firefox, VLC Media Player, Pidgin, etc.

Popular Distributions

Redhat, CentOS, Fedora, Suse, Debian, Ubuntus, etc

Linux Kernal

responsible part about linking the software to the hardware and distributing resources among software applications, it also runs the I/O processes and executes them by passing them to the CPU. It's also responsible for turning on hardware parts like GPU, sound cards, internet cards, RAM, hard disks.. etc. The kernel is the heart of every single operating system and it can't work without it.

What does the command whoami do?

the whoami command prints the user name of the effective user ID. In other words, it displays the name of the currently logged-in user.

What is a boot loader?

-Bootloader is a piece of code that runs before any operating system is running. -Bootloaders usually contain several ways to boot the OS kernel and also contain commands for debugging and/or modifying the kernel environment.

How does Linux Fdisk work and when is it used?

-Fdisk is a dialog-driven command in Linux used for creating and manipulating disk partition table. It is used for the view, create, delete, change, resize, copy and move partitions on a hard drive using the dialog-driven interface. -For basic Linux partitioning tasks, use the fdisk command / utility.

What is a filesystem?

-It's the methods and data structures that an operating system uses to keep track of files on a disk or partition; that is, the way the files are organized on the disk. -Some examples are xfs, ext3, ext4,k zfs, reiserfs, and jfs.

What are kernel modules, how do you list them, add and remove them to a running system?

-Kernel modules are pieces of code that can be loaded and unloaded into the kernel upon demand. They extend the functionality of the kernel without the need to reboot the system. -Usually, all Linux kernel modules (drivers) are stored in the module directory located that /lib/modules/$(uname -r) directory. -The modprobe command intelligently adds or removes a module from the Linux kernel

How does Parted work and when is it used?

-Parted is a famous command line tool that allows you to easily manage hard disk partitions. It can help you add, delete, shrink and extend disk partitions along with the file systems located on them. -To do more advanced Linux partitioning tasks, like resizing a partition or copying a partition, use the parted utility.

What is the role of the system administrator ?

A computer systems administrator maintains an organization's work flow and keeps its lines of communication open. They are responsible for the upkeep, configuration, and reliable operation of computer systems; especially multi-user computers, such as servers.

/etc/gshadow

/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.

What files are involved in user creation?

/etc/passwd and /etc/shadow

What file is the user password stored (on CentOS distribution)?

/etc/shadow file

/etc/shadow

/etc/shadow is a text file that contains information about the system's users' passwords.

What does the directory /usr typically contain?

/usr usually contains by far the largest share of data on a system. Hence, this is one of the most important directories in the system as it contains all the user binaries, their documentation, libraries, header files, etc.

What does the directory /var/log typically contain?

/var/log/messages /var/log/dmesg /var/log/auth.log /var/log/boot.log /var/log/daemon.log /var/log/dpkg.log /var/log/kern.log /var/log/lastlog /var/log/maillog /var/log/user.log /var/log/Xorg.x.log /var/log/alternatives.log /var/log/btmp /var/log/cups /var/log/anaconda.log /var/log/yum.log /var/log/cron /var/log/secure /var/log/wtmp /var/log/faillog

What does tar command do?

It allows for you to quickly access a collection of files and placed them into a highly compressed archive file commonly called tarball, or tar, gzip, and bzip in Linux.

What are disk quotas?

It is a limit set by a system administrator that restricts certain aspects of file system usage on modern operating systems. The function of using disk quotas is to allocate limited disk space in a reasonable way.

Who created the Linux Kernel?

Linus Torvalds

What sort of tool do you use to create hard drive partions?

Linux Fdisk, Parted and Disk Druid

What does a Linux Distribution Consists of?

Linux Kernel, GNU Tools, Display Server, Display Manager (DM), Daemons, Package Manager, Desktop Environment, User Applications.

What does the command nice do?

Nice is a command in Unix and Linux operating systems that allows for the adjustment of the "Niceness" value of processes. Adjusting the "niceness" value of processes allows for setting an advised CPU priority that the kernel's scheduler will use to determine which processes get more or less CPU time.

Where does the httpd config file 'live' by default?

On most systems if you installed Apache with a package manager, or it came preinstalled, the Apache configuration file is located in one of these locations: -/etc/apache2/httpd. conf. -/etc/apache2/apache2. conf. -/etc/httpd/httpd. conf. -/etc/httpd/conf/httpd. conf.

What does open source mean?

Open source software is usually developed as a public collaboration and made freely available

What is SELinux?

Security-Enhanced Linux (SELinux) is a security architecture for Linux® systems that allows administrators to have more control over who can access the system.

tar command

The tar command used to rip a collection of files and directories into highly compressed archive file commonly called tarball or tar, gzip and bzip in Linux. The tar is most widely used command to create compressed archive files and that can be moved easily from one disk to another disk or machine to machine.

mkpasswd command

ecrypts the password using a salt value randomly and automatically. Everytime the command is run it will generate different output everytime.

What does the command fdisk do?

fdisk also known as format disk is a dialog-driven command in Linux used for creating and manipulating disk partition table. It is used for the view, create, delete, change, resize, copy and move partitions on a hard drive using the dialog-driven interface.

What does the command fsck do?

fsck (file system check) is a command-line utility that allows you to perform consistency checks and interactive repairs on one or more Linux file systems. It uses programs specific to the type of the file system it checks.

What does the command hostname do?

hostname command in Linux is used to obtain the DNS(Domain Name System) name and set the system's hostname or NIS(Network Information System) domain name.

What does the command id do?

id is a command-line utility that prints the real and effective user and group IDs.

Boot related

initrd image, inittab, rc.d, loader, kernel, modules, init.d, startup, fstab, /etc/sysconfig scripts.

Display Server

is the responsible software about drawing the graphical user interface on the screen. From icons to windows and menus, every graphical thing you see on the screen is done by a display server.

Where is the kernel stored on a CentOS distro (/boot)?

its stored in /boot the command: $ cat /proc/cmdline can be used to find the kernel path, which also gives the name of said file.

What does the command mkswap do?

mkswap sets up a Linux swap area on a device or in a file. The device argument will usually be a disk partition but can also be a file.

What does the command mount do?

mount command is used to mount the filesystem found on a device to big tree structure rooted at '/'.

Daemons

programs that run in the background of the operating system instead of being normal applications with windows on the user interface. They run some specific jobs and processes that are needed by the operating system

grep command

searches for a specified pattern in a file (or files) and displays in output lines containing that pattern as follows.

ps command

shows useful information about active processes running on a system

'?' - question mark

single character

What does the command stat do?

stat is a command-line utility that displays detailed information about given files or file systems.

What is the difference between 'su' and 'su -' ?

su - logs you in completely as root, whereas su makes it so you are pretending to be root. The most obvious example of this is that ~ is root's home directory if you use su - , but your own home directory if you use su

What does the command renice do?

the renice command modifies the priority of running processes. It is similar to the nice command, but is used for processes that are already running.

What does the command top do?

top command is used to show the Linux processes. It provides a dynamic real-time view of the running system.

What does the command uname do?

uname is a command-line utility that prints basic information about the operating system name and system hardware.

chgrp command

used to change the group ownership of a file. Provide the new group name as its first argument and the name of file as the second argument like this: $ chgrp tecmint users.txt

chmod command

used to change/update file access permissions like this. $ chmod +x sysinfo.sh

kill command

used to kill a process using its PID by sending a signal to it (default signal for kill is TERM).

What does the command users do?

users command in Linux system is used to show the user names of users currently logged in to the current host.

How can you assume root privileges?

using the su command do, $ sudo su and then type in the password of the root account when prompted to.

/etc/group

/etc/group is a text file which defines the groups to which users belong under Linux and UNIX operating system.

What does the directory /etc typically contain?

/etc directory contains configuration files, which can generally be edited by hand in a text editor. Note that the /etc/ directory contains system-wide configuration files

What are system runlevels, name them and what typically occurs in those runlevels, how do you change runlevels (init, halt, reboot, shutdown).

-A runlevel is a preset operating state on a Unix-like operating system. A system can be booted into any of several runlevels, each of which is represented by a single digit integer. Seven runlevels are supported in the standard Linux kernel. -0 - System halt i.e the system can be safely powered off with no activity. 1 - Single user mode. 2 - Multiple user mode with no NFS(network file system). 3 - Multiple user mode under the command line interface and not under the graphical user interface. 4 - User-definable. 5 - Multiple user mode under GUI (graphical user interface) and this is the standard runlevel for most of the LINUX based systems. 6 - Reboot which is used to restart the system. - the telinit command can be used to change the runlevel like canging from 3 to 5 would be $ telinit 5

What are the dangers of automated updates?

-Automatic updates usually can't update firmware or other special types of files. -Updates that haven't been properly vetted can sometimes cause problems. -Updates often take a long time to download and install. In the meantime, normal workloads are interrupted.

What is the boot process to get linux running on a system?

-BIOS loads and executes the MBR boot loader -MBR loads and executes the GRUB boot loader. -GRUB just loads and executes Kernel and initrd images -Kernel executes the /sbin/init program -Init identifies the default initlevel from /etc/inittab and uses that to load all appropriate program. -Runlevel programs start to load up.

Why is it a bad idea to use root account for regular non-maintenance tasks?

-Stupidity: Nothing prevents you from doing something stupid. If you try to change the system in anyway that could be harmful you need to do sudo which pretty much guarantees a pause while you are entering the password for you to realize that you are about to make a possible big/costly change. -Security: It has been mentioned already quite a few times in this question but basically it's the same thing, harder to hack if you dont know the admin user's login account. root means you already have one half of the working set of admin credentials. -You don't really need it: If you need to run several commands as root and you are annoyed by having to enter your password several times when sudo has expired all you need to do is sudo -i and you are now root. Want to run some commands using pipes? Then use sudo sh -c "comand1 | command2". -You can always use it in the recovery console: The recovery console allows you to try and recover from doing something stupid or fixing a problem caused by an app (which you still had to run as sudo :)) Ubuntu doesn't have a password for the root account in this case but you can search online for changing that, this will make it harder for anyone that has physical access to your box to be able to do harm.

What command is used to check the integrity of a partition? How does it work/ is used?

-The command fsck -fsck is a command-line utility that allows you to perform consistency checks and interactive repairs on one or more Linux file systems. It uses programs specific to the type of the file system it checks. You can use the fsck command to repair corrupted file systems in situations where the system fails to boot, or a partition cannot be mounted.

What are the 'critical' fields that define a user in the /etc/passwd file (5 fields)

-Username -Password -User ID (UID) -Home Directory -Command/shell Group ID and User ID info are also there but not critical

What does the yum command do? (install, update)

-YUM is an open source command-line as well as graphical based package management tool for RPM based Linux systems. It allows users and system administrator to easily install, update, remove or search software packages on a systems. -yum install -Install a package from a repository to your system -yum update -Update one or all packages on your system

What are the commands getsebool, setsebool, chcon, restorecon?

-getsebool reports where a particular SELinux boolean or all SELinux booleans are on or off -setsebool sets the current state of a particular SELinux boolean or a list of booleans to a given value. The value may be 1 or true or on to enable the boolean, or 0 or false or off to disable it. -chcon stands for Change Context. This command is used to change the SELinux security context of a file. -restorecon stands for Restore SELinux Context. restorecon command will reset the SELinux security context for files and directories to its default values.

What is initrd? why it is needed?

-initrd stands for Initial RAM Disk. -initrd is used by kernel as temporary root file system until kernel is booted and the real root file system is mounted. It also contains necessary drivers compiled inside, which helps it to access the hard drive partitions, and other hardware.

What command is used to format partitions? How does it work/ is used?

-the mkfs command (also might be fdisk) -The mkfs command is used to create a filesystem on a formatted storage device or media, usually a partition on a hard disk drive (HDD). (fdisk also known as format disk is a dialog-driven command in Linux used for creating and manipulating disk partition table.)

What does the directory /boot typically contain?

/boot folder contains all the boot related info files and folders such as grub. conf, vmlinuz image aka kernel etc.

swapon command

The swapon command is used to specify additional devices on which paging and swapping are to take place.

How does Disk Druid work and when is it used?

Disk Druid is an interactive program for editing disk partitions. Users run it only within the Fedora installation system. Disk Druid enables you to configure Linux software RAID and LVM to provide more extensible and reliable data storage.

What is its name (bzImage, vmlinuz).

For Centos, its vmlinuz. It might be different based on the distro.

What does the command groups do?

Groups command prints the names of the primary and any supplementary groups for each given username, or the current process if no names are given.

What does the command date do?

The date command displays or sets the system date. It is most commonly used to print the date and time in different formats and calculate future and past dates.

What does the command df do?

The df command (short for disk free), is used to display information related to file systems about total space and available space. If no file name is given, it displays the space available on all currently mounted file systems.

What does the command du do?

The du command, short for "disk usage" reports the estimated amount of disk space used by given files or directories. It is practically useful for finding files and directories taking up large amounts of disk space.

what is the difference between hard and soft limits?

The hard limit is the ceiling for the soft limit. The soft limit is what is actually enforced for a session or process. This allows the administrator (or user) to set the hard limit to the maximum usage they wish to allow.

How does the linux kernel track processes?

The kernel keeps track of a processes creation time as well as the CPU time that it consumes during its lifetime. Each clock tick, the kernel updates the amount of time in jiffies that the current process has spent in system and in user mode.

What does the command kill do?

The kill command is used on Linux and other Unix-like operating systems to terminate processes without having to log out or reboot the computer

What does the command mkfs do?

The mkfs command is used to create a filesystem on a formatted storage device or media, usually a partition on a hard disk drive (HDD),

Package Manager

The software used to install, maintain, and remove other software programs by storing all relevant software information in a central software database on the computer.

What does the command who do?

The who command prints information about all users who are currently logged in.

What does the command unmount do?

Use umount to unmount a device / partition by specifying the directory where it has been mounted.

How can all the running system processes be seen?

Using the ps command # ps -aux | less Where, A : Select all processes u : Select all processes on a terminal, including those of other users x : Select processes without controlling ttys

Does the system need swap space to work?

Yes it needs some space to work

What does the swap partition do?

You can create a swap partition that is used by Linux to store idle processes when the physical RAM is low. The swap partition is disk space set aside on a hard drive. It is quicker to access RAM than files stored on a hard drive.

From what sources can Linux be installed

You can find the ISO for the distribution of your choice at the distribution's website. This format needs to be burned to a CD or USB stick before you can use it to install Linux.

How does the system know which processes to start and kill when changing runlevels?

You would see programs that start with S and K. Programs starts with S are used during startup. S for startup. Programs starts with K are used during shutdown. K for kill.

GNU toolchain

a broad collection of programming tools. These tools form a toolchain used for developing software applications and operating systems.

What is a hard drive partition?

a defined storage space on a hard drive

Desktop Environment

a group of applications and libraries that are combined together to provide graphical applications to the user. They provide a lot of core libraries, services, programs for end-users and a lot more. The most known desktop environments on the Linux desktop are GNOME and KDE.

What does the directory /lib typically contain?

a library files directory which contains all helpful library files used by the system. In simple terms, these are helpful files which are used by an application or a command or a process for their proper execution.

'*' - asterisk

all files or all matching strings

Display Manager

are used to show the welcome screen after the boot loader and start desktop sessions as a connection with the X display server. Display managers are the welcome screens that ask you for your username and password before letting you login to your desktop environment.

What is the benefit of automated updates?

automatic updates can help to ensure that your software is protected against security vulnerabilities and other problems.

source rpm(s)

captures the source code and patches as they were at RPM build time. On RPM-based systems source RPMs are RPM files that contain a tarball of source code, patches, auxiliary files that are used during the build process

chown command

changes/updates the user and group ownership of a file/directory.

What does the directory /root typically contain?

contains all other directories and files on the system and which is designated by a forward slash ( / )

top command

displays all processes on a Linux system in regards to memory and CPU usage and provides a dynamic real-time view of a running system.


Conjuntos de estudio relacionados

Ch. 6 Vocab and Review Questions

View Set

Elements of Earth Science Lab: Chapter 1 Quiz

View Set