Lecture 6 User Management and System Administration in Linux
Lecture 6 User Management and System Administration in Linux
• Enable User
$ sudo passwd -u user //unlock
• State of init
• group of processes are defined to start at the startup
of OS
• Mode of operation in the computer operating system
• Each run level has a certain number of services
started or stopped
Run-levels
• Seven Run levels exist ($ runlevel digit or $ init digit)
⚬ 0: Shuts down the system
⚬ 1: single-user mode
⚬ 2: multi-user mode without networking
⚬ 3: multi-user mode with networking (with CLI)
⚬ 4: user-definable
⚬ 5: multi-user mode with networking (with GUI)
⚬ 6: reboots the system to restart it
Run-levels
• By default, Linux based systems boot on runlevel 3 or
5
• user can modify preset runlevels
• create new ones according to the requirements
• Runlevel 2 and 4 are used for user defined runlevels
• runlevel 0 and 6 aur used for shutdown and reboot
the system
Systemd
• Systemd is the new init framework
• system and service manager for Linux operating
systems
• new distros are moving to systemd
• managing services with systemd
⚬ systemctl: control system and services
⚬ journalctl: manage journal, systemd's logging
system
⚬ hostnamectl: control hostname
⚬ localectl: configure locale and keyboard layout
⚬ timedatectl: set time and date
⚬ systemd-cgls: shows cgroup contents
Systemd - services
• see all services (running or not)
⚬ systemctl list-units --type service --all
• Start a service
⚬ systemctl start [service-name]
• Stop a service
⚬ systemctl stop [service-name]
• restart a service
⚬ systemctl restart [service-name]
• reload a service
⚬ systemctl reload [service-name]
Systemd - services
• see service status
⚬ systemctl status [service-name]
• Restart a service if already running
⚬ systemctl condrestart [service-name]
• Enable service at startup
⚬ systemctl enable [service-name]
• Disable service at startup
⚬ systemctl disable [service-name]
• check if service is enable at start up
⚬ systemctl is-enabled [service-name]
Systemd - services
• create new serivce file or modify configuration
⚬ systemctl daemon-reload
• systemctl halt
• systemctl poweroff
• systemctl reboot