EXTRAS Flashcards Preview

Rhcsa > EXTRAS > Flashcards

Flashcards in EXTRAS Deck (83)
Loading flashcards...
1

mount an ISo

#mount -o loop media.iso /media

2

Set same SELinux context for a directory

#chcon -R --reference=/var/www/html/ /var/www/html/inst

3

FTP and http file location

vsftp server is /var/ftp/pub
HTML is /var/www/html

4

example setting up a VSFTP server and upload DVD installation

#yum install vsftpd
#service vsftpd start
test that you can connect to ftp://127.0.0.1
#chkconfig vsftp on
# mkdir /var/ftp/pub/inst -> create directory to copy files
#mount -ro loop download.iso /media -> use iso or DVD
#mount /dev/cdrom /media -> mount dvd
# cp -ar /media/. /var/ftp/pub/inst
#chcon -R -t public_content_t /var/ftp/ -recursively set SELinux context
#service vsftpd restart

5

add/remove software tool is located

System -> administration -> add/Remove Software

6

List of packages needed for virtualization

qemu-kvm - the main kvm package
python-virtinst - command line tools and libraries for creating VMS
virt-manager - GUI VM administration tool
virt-top - command for VM statistics
virt-viewer - GUI connection to configure VMs
libvirt - c language toolkit with the libvirtd service
libvirt-client - c language toolkit for VM client

7

check if the right VM modules are located

#lsmod | grep kvm
output should return either kvm-intel or kvm-adm
if the output is different or no output run this command to add:
#modprobe kvm

8

virt-install

You can also use the virt-install --prompt command to set virtual machines, just enter information as asked such as RAM, CPU, and so forth
# virt-install --prompt

9

virt-install to install a VM with a kickstart file

The virt-install --prompt command can be used to install from a kickstart. Example
# virt-install -n outside1.example.org -r 768 --dis \
path=/var/lib/libvirt/images/outsider1.example.org.img \
-l ftp://192.168.122.1/pub/inst \
-x "ks=ftp://192.168.122.1/pub/ks1.cfg"

10

switches for the virt-install command

-n (--name) sets the name of a VM
-r (--ram) configures the amount of RAM in MB
--disk defins the virtual disk
-l (--location) specifies the directory or URL wit hthe installation files
-x (--extra-args=) includes extra data, such as the url of a kickstart file.

11

virt-clone --prompt

the virt-clone --prompt command can be used t oclone an existing VM. Make sure the system to be cloned is shutdown.

12

Tools of interest for administrative purposes

- telnet and nmap to verify remove access to open ports
- mutt as an email client to verify the functionality of an email server
- elinks as a web browser to make sure web services are accessible
- lftp to access ftp servers with command completion

#telnet localhost 21
# nmap localhost
#mutt -f pop://username@host
you can also use the mail command as:
$mail Michael
subject: test
cc: marth@example.com
$mail -s 'host file' < /etc/hosts root@localhost
$elinks http://127.0.0.1/inst
$lftp ftp.example.org -u frany

13

lftp standard commands

cd - changes the current working directory at the remote host
ls - list files at the remote host
get - retrieve one file from the remote host
mget - retrieve a group of files from the remote host
put - uploads one file from your computer to remote host
mput - uploads a group of files to remote host
pwd - list current working directory to the remote host
quit - ends the FTP session
!ls - list files on your host computer in the current directory
!cd - change the local host directory fur upload/download
!pwd - list current working directory on local host computer

14

The Alias command examples

some alias command examples:
#alias cp='cp -i'
#alias l.='ls -d .* --color-=auto'
#alias ll='ls -l --color=auto'
#alias rm='rm -i'
#alias rm ='mv -t ~/.trash'

15

the locate command database

the locate command database is normally updated only once each day base on this cron /etc/cron.daily/mlocate.cron (might have to manually run)

16

Specialized variations on the vi command:

vipw - edit /etc/passwd
vigw - edit /etc/group
visudo - etdit /etc/sudoers
vipw -s - edit /etc/shadow
vigr -s - edit /etc/gshadow

17

arp command

The arp command displays a table of hardware and IP addresses on the local computer. ARP can help detect problem such as duplicate addresses on the network

18

displaying routing table

#netstat -r -> displays routing table, similar to route
#route -n -> similar to #netstat -rn

19

get dhcp info

#dhclient eth0

20

two tools that can be used to configure network devices:

System-config-network -GUI
nm-connection-edit - GUI command line
System-preferences-network connections

21

check DNS server

if in doubt about whether the DNS server is operational:
#dig @192.168.122.1 mheducation.com

22

default umask

The default umask is driven by the /etc/bashrc file

23

remount a file system

#mount -o remount /home

24

common ports

21 - FTP
22 - secure shell (SSH)
23 - telnet
25 - SMTP
53 - DNS
80 - http
88 - kerberos
110 - pop
139 - netbios
143 - IMAP
443 - https
993 - IMAP over SSL
2049 - NFS4
995 - POP over SSL
69 - TFTP
139 & 445 as well as UDP 137 & 138 - SAMBA

25

diagnose error when running semanage login -l

#yum whatprovides /usr/sbin/semanage
#yum -y install policycoreutils-python

26

options for SELinux user roles

-guest_u no GUI, no networking, no access to the SU or sudo command
-xguest_u GUI, networking only via the firefox web browser
-user_u GUI and networking available
-staff_u GUI, networking, and the sudo command available
-unconfined_u Full system access

27

tools to search /var/log/audit

#ausearch -m avc -c sudo
#sealert -a /var/log/audit/audit.log

28

other facl command

#getfacl file | setfacl --set-file = - file2 -> copy acl from file1 to file2
#getfacl --access dir | setfacl -d -M-dir -> copy the access acl into the default ACL

29

GRUB common errors

error 15: file not found - the partition was mounted; the kernel was not found on that partition. Cause: root(hdx,y) directive does not point to the partition with /boot directory
ERROR 17: cannot mount selected partition: the partition is not formatted to a filesystem with files. Cause: the root(hdx,y) directive points to a partition formatted to a system such as linux swap
ERRO 22: no such partition: there is no partition specified by the root (hdx,y) directive.

30

list commands at group command line

To see a list of commands at the GRUB command line, press the tab key at the grub > prompt.
To find the grub.conf file (find the /boot directory)
grub > find /grub/grub.conf
Another way to find the /boot directory
grub > root
to confirm the location of grub.conf, run the cat command:
grub > cat (hd0,0) /grub/grub.conf