Linux System Administration
last edited Wed, 24 Jul 2024 05:21:40 GMT
backlinks: null
This guide does not cover Securing Linux servers
Booting direct link to this section
Stop the GRUB boot process by pressing <Escape>
during the brief time before it boots the default kernel in the default way.
- boot alternative kernel
- modify selected kernel
Daemons direct link to this section
- List the states of all services configured to attempt to start:
systemctl
- List all available services and whether they are enabled or not:
systemctl list-unit-files
- list details of two services
systemctl status service1 service
Enabled services will not start until next boot, services that are started will not automatically start at reboot.
Print Working Directory direct link to this section
pwd
Create a New User direct link to this section
Creating a new user with a -m
flag results in a home directory being created
sudo useradd -m username
interactive prompt, actually a front end for useradd
adduser <user>
view all available options
useradd -h
set user password
passwd user02
add user to superuser group direct link to this section
usermod -aG sudo <user>
Managing Permissions direct link to this section
Access Level | Octal Value |
---|---|
read | 4 |
write | 2 |
execute | 1 |
chmod 740 file2
# chmod u=rwx,g=r,o-rwx file2
This is commonly refered as absolute mode.
Building Software From Source direct link to this section
Everyone hits this wall when their chosen distro do3esn't have a specific package.
Assuming you are building from tar
archives:
./configure
make
make install
For RPM based systems:
cd ~/rpmbuild/SPECS
rpmbuild -bb package.spec
tree ../RPMS
rpmbuild --clean package.spec
rpm -Uvh ../RPMS/arch/package-file.rpm
Check SSH Logs direct link to this section
cat /var/log/auth.log | grep "Failed password"
FAQ direct link to this section
Where should scripts be kept?
- personal go in
~/bin
- root only scripts in
/usr/local/sbin
- system-wide
/usr/local/bin