Repos Flashcards
(200 cards)
Steps to add a repo
- Create a .repo file in /etc/yum.repos.d with:
dnf config-manager --add-repo="file:///repo/AppStream"
- Edit the newly created file AppStream.repo in /etc/yum.repos.d
- Set gpgcheck=0
- Verify availability of the repo with:
dnf repolist
Steps to reset a lost root password
- Boot to the grub menu
- Press āeā
- On the line that loads the kernel add
init=/bin/bash
as a boot argument - Ctrl-x to boot with this option
mount -o remount,rw
passwd
- touch /.autorelabel
exec /usr/lib/systemd/systemd
reboot
Command to install bash tab completion
dnf install bash-completion
Search man pages for string
man -k string
Update the mandb
sudo mandb
Two user local bash scripts
-
~/.bash_profile
- Executed for all login shells -
~/.bashrc
- Executed for all non-login interactive shells
Tar create .tar archive
tar -cvf /output/path.tar /path/to/archive
Extract tar archive
tar -xvf /path/to/archive.tar
Display overview of all mounted devices
mount
Display available disk space on all mounted file systems
df -Th
Mount all file systems specified in /etc/fstab
mount -a
List files in order of last modified
ls -lat
Create a new user account
useradd example.user
Add a user to a supplemental group
usermod -aG example.group example.user
Add a new group
groupadd example.group
Delete a user and their home dir
userdel -r example.user
Delete a group
groupdel example.group
Remove a user from a group
gpasswd -d example.user example.group
Get a list of all users
cat /etc/passwd
Get a list of all groups
cat /etc/group
File that contains default user properties
/etc/login.defs
Change password expiration and user disablement policies
chage example.user
Visudo line to allow user to change passwords except for root
example.user ALL=/usr/bin/passwd, !/usr/bin/passwd root
Repair the sudo configuration assuming you broke it
pkexec visudo