Important paths Flashcards

1
Q

Set a users account to expire now and prompt to change on next login

A

Passwd -e user

Chage -M 0 user

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Create 5 T vdo drive

Format xfs the mount permanently to /data

A

First make sure it installed
Yum install know-kvdo vod

vod create —name =vdo1 —device /dev/sdg1 —vdoLogicalSize=5T
Mkfs.xfs -K /dev/mapper/vdo1

vi /etc/fstab

/dev/mapper/vdo1 /data xfs x-systemd.requires =vdo.service 0 0

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Change root password if you don’t know it can’t login

A

Edit grub rd.break
Ctrl + x

Mount -o remount,two /sysroot

Chroot /sysroot
Passwd

Touch /.autorelabel
Exit exit

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Add group owner to every file and directory in directory /dirname and make sure no one in group is able to delete files created in folder

A

Chmod g+s /dirname

Chmod + t /dirname

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Give stacy rw acl permissions on a secure file or directory

Give another group acl rwx permission on directory

A

Setfacl -m u:stacy:rw file name

Setfacl -m d:u:stacy:rw /dirname

Setfacl -m d:g:group:rwx /dirname

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Set time zone and ntp service make sure it’s running

configure chrony to user time.google.com server

A

Timedatectl set-default “America/New_York”
Timedatectl set-ntp true

Systemctl status chronyd
first downlownd and install chrony

then edit the file
/etc/chrony.conf

pool iburst

enter the address they give you
pool time.google.com iburst

make sure its running
systemctl start chronyd
systemctl enable chronyd — makes it persistent
systemctl status chronyd

or
systemctl enable chronyd –now

chronyc sources – will list all the sources in your pool

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Set default boot to multiuser

A

Systemctl set-default multi-user. Target

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Edit grub to boot on scilenced

A

Vi/etc/default/grub

Grub2-mkconfig -o /boot/grub2/grub.cfg
Reboot

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Change selinux to enforcing permanently

A

Find / - name selinux

/etc/selinux/config
Change to enforcing
Reboot

Sestatus

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Create an archive

A

Tar -cvf new.tar file name to backup

Tar -cvzf new.tar.gz file name to backup

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Set a static connection with your settings recieved from dhcp

A

Nmcli c add con-name static ifname device name enps03 ip4 192.178.1.99/24 gw4 192.168.1.1 autoconnect true type Ethernet

Nmcli con mod static ipv4.dns 8.8.8.8

Nmcli con up static
Ping gw
Ping Google

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Create a new user with uid 1099 and another user mike with no login

A

User add -u 1099 rick

User add -s /sbin/no login Mike

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

setup autofs /autofs/nfsshare for 192.168.1.65:/home/automount

A

yum install autofs -y

check nfs shares

showmount -e 192.168.1.65

mkdir -p /autofs/nfsshare

# vi /etc/auto.master
/autofs    /etc/auto.julien   -timeout=120
Or # vi /etc/auto.master.d/julien.autofs
/autofs    /etc/auto.julien   -timeout=120
# vi /etc/auto.julien
nfsshare -fstype=nfs4,rw,sync  192.168.1.65:/home/automount

systemctl start autofs

systemctl enable autofs

systemctl status autofs

ll /autofs/nfsshare
cd /autofs/nfsshare

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

create a thin provisioned 5T drive and mount to data directory

A
# yum install -y vdo kmod-kvdo
# systemctl enable --now vdo

vdo create –name=vdo1 –device=/dev/sdb –vdoLogicalSize=5T

mkfs.xfs -K /dev/mapper/vdo1
# mkdir /data
# vi /etc/fstab
#/dev/mapper/vdo1 /data xfs x-systemd.requires=vdo.service 0 0
# mount -a

reboot

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Setup tuned to the recommended settings

A

Yum install tuned
Systemctl enable tuned —now

Tuned-adm recommended

tuned-adm profile virtual-guest

tuned-admin active

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Install semanage

and add 8761/tcp for apache (http)

A

Dnf provides semanage to get package name

Dnf install pkg name

install semanage

to find which package you need for a program or command
dnf provides semanage – will show me the pkg name to install

then install
dnf install pkgname

used to manage the policy internally

semanage port -l | grep http shows you all protocals and ports for http the selinux allows

semanage port -a -t http_port_port_t 8761/tcp - would add port 8761 to an approved port

semanage port -a -t http_port_port_t -p 8761/tcp

Semange port manage port policy -a append -t http_port_port_t selinux label -p 8761/tcp is the port and protocal to apply policy to

semanage port -l list all of the lables and ports that has been granted access

semanage fcontext -l

#less/var/log/messages will show permission issues with selinux eg appach cannot access port check selinux
#sealert -l
17
Q

reduce fs to 1G on lv

A

1)df -h
2)unmount -umount
3)e2fsck -f /dev/mapper/vg-lv - to check fs of lv
4) resisize2fs /dev/mapper/vg-lv 1G
5)lvreduce -L 1G /dev/mapper/vg-lv
6) mount -a
7 df -h

18
Q

where is the pe size set

A

on the volume group vgcreate -s 16M

the pe is set on the LV lvcreate -l 50

19
Q

how to calculate lv size given the Physical extent size 16M and the applied pe is 75

A

dnf install bc

echo 75*16 | bc