Linux Security Flashcards
File Types
- Regular
d - directory
l - linksoft link
c - special or device /dev
s - socket
/dev/log - used for communication between processes like syslog
p - named pipe Allow communication between two local processes
b - block device/dev
How to change the owner or group on a file/directory
chown chgrp -R
Change the permissions on this to rwx for user group and other
chmod 777 this
chmod u+rwx,g+rwx,o+rwx this
How do you know a file has an acl on it
setfacl for a user
now a group
now recursively
remove user
remove all entries
If you give a user the w permission can they delete?
+ at the end of the permissions
setfacl -m u:delsinm:rwx /home/delinsm/fart.txt
setfacl -m g:delsinm:rwx /home/delsinm/fart.txt
setfacl -rm u:delsinm:rwx /home/delinsm/fart.txt
setfacl -x u:delsinm /home/delsinm/fart.txt
setfacl -b /home/delsinm/fart.txt
No
Change the greeting message for the server
vi /etc/motd
or
vi /etc/profile.d/motd.sh
vi /etc/ssh/sshd_config
ReadMotd no
systemctl restart sshd
Orphan Packages
Package dependencies of deleted packages
How to find and delete orphaned packages
dnf install yum-utils
package-cleanup –leaves
dnf remove ‘package-cleanup –leaves’
difference between update and upgrade
upgrade deletes the old packages so if something goes wrong you can’t roll back
update preserves old packages
Show your system version two ways
cat /etc/redhat-release
uname -a
delete something that you’ve downloaded via dnf
dnf history
dnf history undo 2
update system (this is something you should do for security)
dnf update
dnf upgrade
Difference between a service and a package
Service is something that runs as a process in your machine
When a service isn’t used it’s just a package
How to disable services through PAM
If you see services you don’t use, just change their names and it will disable
Different ways to show services
netstat -l (shows listening “ready” packages/services
netstat -tunlp
systemctl -a
systemctl –list-all
chkconfig –list
service –stat-all | grep running
ps -ef (just the running one’s opposed to netstat -l)
Disable a httpd
systemctl stop httpd
chkconfig httpd off
Why should you partition different directories like
/boot
/usr
/home
/tmp
/var
/opt
This will make it harder for malware to spread
Also, if one fills up completely, like /tmp, it won’t affect the root directory.
What do you used if you want to extend a disk?
LVM
Logical Volume Management
What does Ctrl+Alt+Del
can log you out and reboot
Check if Ctrl+Alt+Del is enabled
Disable Ctrl+Alt+Del (non-gui)
Disable Ctrl+Alt+Del (with gui)
systemctl status ctrl-alt-del.target
systemctl disable ctrl-alt-del.target
older
/etc/init/control-alt-delete.conf
(set parameter as no)
System tools
settings
devices
keyboard
double click logout
press delete and then set
Show all targets
show default target
systemctl list-units –type target
systemctl get-default
systemctl set-default whatever