Command used to copy a file
What is cp source_file destination_file?
This command creates a user and assigns them to a group
what is useradd -G groupname username?
This command generates an SSH key pair
what is ssh-keygen?
This command shows all network interfaces and their IPs.
what is nmcli device show or ip a?
This command lists all block devices and their mount points
what is lsblk?
Command used display only the first 5 lines of a text file
what is head -n 5 filename?
Command to change a file’s ownership to a different user and group.
what is chown user:group filename?
This command to copy your public SSH key to a remote host
what is ssh-copy-id user@hostname?
This command sets a static IP with nmcli
what is: nmcli con mod name ipv4.addresses IP/24 ipv4.gateway GW ipv4.method manual?
This command mounts /dev/sdb1 to /mnt
what is mount /dev/sdb1 /mnt?
Used to append command output to an existing file.
What is >> ?
echo "text" >> filename
This command sets the default permissions for new files (hint: oposite of chmod)
umask
This method is used to disable root login via SSH
what is Edit /etc/ssh/sshd_config and set PermitRootLogin no?
This command sets the hostname of a system
what is hostnamectl set-hostname newhostname?
This command finds all files owned by user contractor1 and group contractor
what is find / -user contractor1 -group contractor?
Command that creates a symbolic (soft) link to a file
What is ln -s target link_name?
This command is used to find the process using the most CPU and kill it.
what is ps -eo pid,%cpu --sort=-%cpu | head, then kill PID
This method is used to disable password login and allow only SSH key authentication
what is PasswordAuthentication no in /etc/ssh/sshd_config?
This command assigns a second IP to an interface using nmcli
what is nmcli con mod name +ipv4.addresses second_ip/24?
This command finds files exactly 100 bytes in size
What is find / -type f -size 100c?
command used to find and list all files larger than 10MB under /home.
What is find /home -type f -size +10M?
These commands sets a directory so all created files inherit the group and users can’t delete others’ files
what is chmod 2770 dir and chmod +t dir?
This command installs the zsh shell on RHEL
what is dnf install zsh?
This makes client1 resolve to 172.25.250.10 locally
what is Add 172.25.250.10 client1 to /etc/hosts?
This command saves the full path of a file named review5-path to a file.
What is find / -name review5-path > /mnt/review5-path.txt?