Linux Command Line Tools and Configuration Files, Exams of Nursing

A comprehensive overview of various linux command line tools, configuration files, and system concepts. It covers a wide range of topics, including network management, logical volume management, user and group management, file system management, kernel module management, and more. Structured in a question-and-answer format, making it a valuable resource for linux system administrators and users who need to quickly reference common commands, configuration files, and system behaviors. The level of detail and breadth of coverage make this document suitable for use as study notes, lecture notes, or a reference guide for university-level courses related to linux system administration, operating systems, or computer networks.

Typology: Exams

2023/2024

Available from 09/30/2024

Examproff
Examproff 🇺🇸

3

(2)

8.3K documents

1 / 10

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
RHCSA EX200 Solved 100% Correct 2024
1. cmd to install sealert.
2. Why is sealert helpful
3. Where is the sealert log directory - ANS-1. yum install setroubleshoot-server -y
2. sealert makes it easier to read SELinux messages
3. written to /var/log/messagesclear
1. what is the tar utility?
2. how would you create an archive?
3. how would you extract an archive?
4. how would you extract one file from an archive? - ANS-1. Utility used to create
archives
2. tar -cf [archivename.tar]
3. tar -xvf [archivename.tar]
4. tar-xvf [archivename.tar] [filename]
1. what tool(s) can you use to edit network connections?
2. where are the network connection files stored? - ANS-1. nmcli - cmd line tool, nmtui -
text interface tool
2. /etc/sysconfig/network-scripts
cmd to add 75% of all free disk space to the logical volume - ANS-lvresize -r -l
+75%FREE
cmd to add 75% of the total volume group size to the logical volume - ANS-lvresize -r -l
+75%VG (path to logical volume)
cmd to add a filesystem to a device - ANS-mkfs.(file system) (device)
mkfs -t (file system) (device)
cmd to apply context label "type" policy on a directory - ANS-semanage -a -t (context
type) "[directory](/.*)?"
cmd to change an SELinux boolean value permanently - ANS-setsebool (context type)
(on/off) -P
cmd to change attributes - ANS-chattr
cmd to change file ownership - ANS-chown
cmd to change users primary group - ANS-newgrp
cmd to discover files on the system - ANS-find
cmd to display information about kernel modules - ANS-modinfo
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download Linux Command Line Tools and Configuration Files and more Exams Nursing in PDF only on Docsity!

RHCSA EX200 Solved 100% Correct 2024

  1. cmd to install sealert.
  2. Why is sealert helpful
  3. Where is the sealert log directory - ANS-1. yum install setroubleshoot-server -y
  4. sealert makes it easier to read SELinux messages
  5. written to /var/log/messagesclear
  6. what is the tar utility?
  7. how would you create an archive?
  8. how would you extract an archive?
  9. how would you extract one file from an archive? - ANS-1. Utility used to create archives
  10. tar -cf [archivename.tar]
  11. tar -xvf [archivename.tar]
  12. tar-xvf [archivename.tar] [filename]
  13. what tool(s) can you use to edit network connections?
  14. where are the network connection files stored? - ANS-1. nmcli - cmd line tool, nmtui - text interface tool
  15. /etc/sysconfig/network-scripts cmd to add 75% of all free disk space to the logical volume - ANS-lvresize -r -l +75%FREE cmd to add 75% of the total volume group size to the logical volume - ANS-lvresize -r -l +75%VG (path to logical volume) cmd to add a filesystem to a device - ANS-mkfs.(file system) (device) mkfs -t (file system) (device) cmd to apply context label "type" policy on a directory - ANS-semanage -a -t (context type) "directory?" cmd to change an SELinux boolean value permanently - ANS-setsebool (context type) (on/off) -P cmd to change attributes - ANS-chattr cmd to change file ownership - ANS-chown cmd to change users primary group - ANS-newgrp cmd to discover files on the system - ANS-find cmd to display information about kernel modules - ANS-modinfo

cmd to download kernel - ANS-yumdownloader kernel (will download an rpm package) cmd to get a list of SELinux booleans - ANS-semanage boolean -l cmd to list attributes - ANS-lsattr cmd to list currently loaded kernel module - ANS-lsmod cmd to list kernel updates - ANS-yum list kernel cmd to load kernel modules and all of their dependencies - ANS-modprobe cmd to reduce logical volume by 100M - ANS-lvreduce -r -L -100M (path to logical volume) cmd to resize logical volume to 75% of free disk space - ANS-lvresize -r -l 75%FREE cmd to resize volume group to 75% of its total disk space - ANS-lvresize -r -l 75%VG (path to logical volume) cmd to set group password - ANS-gpasswd cmd to setup virtualization - ANS-yum groupinstall -y "Virtualization Host" cmd to unload kernel modules, considers their dependencies - ANS-modprobe -r cmd to write context label to file system - ANS-restorecon -R -v (directory) command for modifying user properties - ANS-usermod command to add users to the system - ANS-useradd command to change user password expiry information - ANS-chage command to copy the public key to the target server - ANS-ssh-copy-id [username]@[ipaddress] command to create groups - ANS-groupadd command to get info about a user account - ANS-id [username] command to modify groups - ANS-groupmod command to remove users from the system - ANS-userdel

0(minute), 0(hour), 0(D Month), 0(Month), 0(D Week) 0, 0, 0, 0, 0 Explain the file system heirarchy / /bin /boot /dev /etc /home /lib, /lib /media, /mnt /proc /opt /root /run /sbin /srv /sys /tmp /usr /var - ANS-/ - root directory, where the file system tree starts /bin - Find executable programs that are needed to repair a system. Directory is essential during boot /boot - Contains all files/dirs that are needed to boot /dev - Device files that are used for physical device access /etc - Contains configuration files /home - local home user directories /lib, /lib64 - shared libraries used by /boot,/bin,/sbin /media, /mnt - Directories used for mounting devices /proc - Gives access to kernel information /opt - used for optional packages /root - root home directory /run - processes since last boot. empties when powered off /sbin - similar to bin. used by adminstrators /sys - used as an interface to different hardware devices that are managed by the kernel /srv - used for data that may be used for services such as NFS,FTP,HTTP /tmp - contains temp files /usr - contain subdirectories for program files, libraries for program files, and documentation about them /var - contains files that may change in size dynamically such as log files, spool files and mail boxes Explain the following environment configuration files /etc/profile /etc/bashrc

~/.bash_profile ~/.bashrc - ANS-/etc/profile - generic file processed by all users upon login /etc/bashrc - This file is processed when subshells are started ~/.bash_profile - User specific variables that can be defined ~/.bashrc - User specific subvariables that can be defined Explain the following file descriptors > >> 2> 2>& < - ANS-> - Redirects stout - creates files or overwrites >> - Redirects stout - creates or appends to file 2> - Redirect sterr 2>&1 - Redirects sterr to stout < - Redirects stdin Explain the following systemd statuses

  1. Loaded
  2. Active
  3. Enabled
  4. Disabled
  5. Static
  6. Inactive - ANS-1. Loaded - Unit is active, loaded into memory
  7. Active - Running with one or more active processes
  8. Enabled - Configured to autostart
  9. Disabled - Will not be started at boot time
  10. Static - Can not be enabled, may be started by another unit
  11. Inactive - Not running explain the options in /etc/fstab Device Mountpoint File System Mount Options Dump Support Automatic check - ANS-Device - device to be mounted (UUID, Label, Name) Mountpoint - location where the device to be mounted File System - The file system type Mount Options - Specify mount options Dump Support - enable for backup solutions Automatic check - specifies filesystem check while boot explain the sticky bit - ANS-prevents files from accidental deletion. Can only delete files that you're the owner of. Denoted with a t.
  1. systemctl halt / halt
  2. systemctl poweroff / poweroff force reset: echo b>/proc/sysrq-trigger list octal permission bits why use a capital X for execute permissions? - ANS-4 - read 2 - write 1 - execute capital X is used to set execute permissions on directories only list two ways to configure firewalld - ANS-firewall-cmd firewall-config location of apache main configuration file - ANS-/etc/httpd/conf/httpd.conf main configuration file for crontab - ANS-/etc/crontab Name 3 tools for LDAP authentication - ANS-1. authconfig - cmd line tool for ldap authentication
  3. authconfig-tui - menu driven text user interface for ldap authentication
  4. authconfig-tki - GUI config utility for ldap authentication package to install to auto completion - ANS-yum -y install bash-complete packages to automount a home directory - ANS-autofs nfs-utils openldap-clients packages to setup ldap - ANS-yum group install "Directory Client" -y rpm command to install kernel - ANS-yum -ivh kernel(tab complete) set files ACLs - ANS-setfacl steps to change grub timeout: - ANS-1.edit /etc/default/grub "Grub timeout" 2. write grub changes: grub2-mkconfig -o /boot/grub2/grub.cfg Steps to connect LDAP client - ANS-1. check ping status
  5. install authconfig-gtk, nss-pam-ldap, pam_krb
  6. Enter required DN, and LDAP server credentials. dc=domainname,dc=com ldap://ldap.domainname.com Select "Create Home directories on first login" 4 install autofs, nfs-utils, openldap-clients
  7. create file /etc/auto.master.d/auto.ldap
  8. Add: * -rw ldap.domainname.com:/home/guests/&
  9. edit /etc/pam.d/sshd
  10. add:

auth sufficient pam.ldap.so auth sufficient pam_permit.so

  1. systemctl enable autofs && systemctl start autofs && systemctl restart sshd steps to install SELinux specific manpages - ANS-1. yum install -y policycoreutils-devel
  2. sepolicy manpage -a -p /usr/share/man/man
  3. mandb
  4. man -k _selinux steps to recreate initramfs - ANS-1. boot to rescue mode
  5. run "dracut" cmd systemd cmd to find dependencies - ANS-systemctl list-dependencies to automount user home folders, what file do you edit - ANS-/etc/auto.master.d/ldap.autofs add the following line: /home/guests /etc/auto.ldap tool for getting info about an xfs filesystem - ANS-xfs_info /path-to-device tool for managing ext4 filesystems - ANS-tune2fs tool for managing xfs filesystems - ANS-xfs_admin tools for managing extending logical volumes with xfs - ANS-xfs_growfs /path-to-lv what a KVM - ANS-Kernel Virtual Machine. only works in 64bit What are context settings in SELinux - ANS-Context labels define the nature of the item,
  • SELinux rules are created to match the context labels of source objects, to context labels of target objects What are daemons? - ANS-process that provide services. generally run in the background What are hard links? - ANS-Inodes, access a files from a different location [ln (source) (destination)] what are shell jobs - ANS-cmds started from the cmd line what are soft links - ANS-allows you to access a file by filename and not inode [ln -s (source) (destination)] what do you need to edit to provide read/write access for users with auto mounted directories - ANS-edit /etc/auto.ldap

What is SELinux - ANS-Provides mandatory access control to a linux server where every system call is denied unless it has been specifically allowed what is the $Path - ANS-Defines a list of directories that search for a filename when a user enters a command what is the command to generate a public/private keypair - ANS-ssh-keygen what is the console - ANS-The environment the use is looking at what is the cron daemon - ANS-process that checks every minute to see if there is work to do (crond) what is the cron service - ANS-a service started by default on rhel systems what is the jobs cmd - ANS-shows which jobs are currently running in the shell what is the terminal - ANS-Opened in a console, provides access to the shell what is virsh - ANS-cmd line vm editor where are the public and private keys stored by default - ANS-~/home/[username]/.ssh where are the systemd unit files located by default - ANS-/usr/lib/systemd/system where are yum actions logged - ANS-/etc/log/yum.log where can you find the configuration files for rsyslogd - ANS-/etc/rsyslogd.conf where can you modify systemd specific modifications. - ANS-/etc/systemd/system where does SELinux log activity - ANS-/var/log/audit/audit.log Where is the config file for SELinux - ANS-/etc/sysconfig/selinux where is the public key stored on the remote host - ANS-~/.ssh/authorized_keys where is the systemd runtime configuration stored - ANS-/run/systemd/system Why would you use LDAP Servers - ANS-1. Organized like DNS, using domains to organize users

  1. Distributed because the entire database doesn't need to be on a single server
  2. Replicated - multiple copies of one partition can be create