Using the root user account - Exploring administrative commands,
configuration files, and Log files - Using other administrative accounts - Lab:
Implementing privilege escalation - Using shell variables, expanding arithmetic
expressions Expanding variables - Lab: Manipulating environmental/shell
variable - Getting information about commands and help - Managing user
accounts in UBUNTU - User management - Lab: Managing regular user account
- Group management - Lab: Group management- Moving around the file
system UBUNTU - File management - Lab: Working with basic file system -
Permission management - Lab: Working with file system permissions - Access
control lists - Lab: Managing user and group permissions - Working with text
files in UBUNTU.
About Shells and Terminal Windows
Using the Shell Prompt
Shell Prompt:
o $ → Regular user prompt.
o # → Root user prompt.
Usage: If the GUI is unavailable, the shell prompt is your primary interface for
interacting with the Linux system.
Using a Terminal Window
Ways to open a terminal from the GUI:
o Right-click the desktop and select "Open in Terminal" or similar.
o Use a panel menu to launch the terminal application.
Using Virtual Consoles
Virtual consoles provide multiple text-based terminal sessions (accessible via
Ctrl+Alt+F1 to Ctrl+Alt+F6).
To return to the GUI:
Ctrl+Alt+F1
Example: Press Ctrl+Alt+F3 to open a plain-text login prompt, then log in with your
credentials.
Choosing Your Shell
, Default shell: bash in most Linux systems.
To check your default shell:
grep username /etc/passwd
Replace username with your actual username. The output shows the shell
configuration.
Using the root user account
Exploring administrative commands, configuration files,
and Log files
Category Command/File Description
Administrative sudo
Execute commands with superuser (root)
Commands privileges.
su Switch user, often used to switch to root.
chmod Change file permissions.
chown Change file ownership.
useradd Add a new user to the system.
usermod Modify an existing user's attributes.
userdel Delete a user account.
groupadd Add a new group.
groupdel Delete a group.
passwd Change user password.
df Report disk space usage.
du Estimate file space usage.
Contains user account information (e.g.,
Configuration Files /etc/passwd
usernames, UIDs).
/etc/group Defines groups of users on the system.
/etc/fstab
Contains static information about disk
drives and partitions.
/etc/network/interfaces
Configuration file for network interfaces
(Debian-based systems).
/etc/hostname The system's hostname.
/etc/resolv.conf
Configuration for DNS resolution
(nameservers).
/etc/ssh/sshd_config Configuration file for the SSH daemon.
/etc/sudoers
Configuration file defining user privileges
for sudo.
/etc/sysctl.conf Kernel parameters to be set at boot time.
General system log file (records system
Log Files /var/log/syslog
events).
/var/log/auth.log
Log file for authentication attempts,
including sudo and login attempts.
, Category Command/File Description
/var/log/dmesg
Kernel ring buffer logs, often used for boot
diagnostics.
/var/log/messages
System messages, used for general logs
(often in RedHat-based distros).
Security-related log file (typically stores
/var/log/secure auth and sudo logs on RedHat-based
systems).
/var/log/boot.log Boot-related logs.
/var/log/kern.log
Kernel logs, stores messages from the
kernel itself.
/var/log/cron
Cron job logs, stores output from
scheduled cron jobs.
Shell Variables in Linux
Shell variables are placeholders used to store and manage information within a shell session.
These variables can hold values like strings, numbers, or command output and are used in
shell scripts or command-line operations.
Types of Shell Variables
1. Local Variables: Defined in the current shell session and not inherited by child
processes.
2. Environment Variables: Exported to child processes and used system-wide.
3. Special Variables: Predefined by the shell, such as $0, $1, $?.
Common Operations with Shell Variables
1. Assigning a Variable
To assign a value to a variable:
variable_name=value
Example:
myvar="Hello, World!"
echo $myvar
Output: