As a system admin, you'll be dealing with a number of important files.
When performing root-level tasks, you may do so in three different ways:
sucommand to login as root user.
sudocommand, which allows you to input a single command as the root user.
The settings in the last of these options is configured through a file named /etc/sudoers. It may be accessed with the
Opening the file with
visudo is different from opening it in a regular text editor in that it validates the syntax before closing.
The /etc/passwd file contains a list of all users and system listing. You may delete a user from the system just by deleting their corresponding line in this file. The
usermod command is simply an interface for editing this file and /etc/shadow.
If you open this file, you'll see a colon-separated line with 6 sections:
$ cat /etc/passwd root:x:0:0:root:/root:/bin/bash daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin bin:x:2:2:bin:/bin:/usr/sbin/nologin sys:x:3:3:sys:/dev:/usr/sbin/nologin
Each line represents a user, along with seven parameters:
The encrypted password will show as an
x and is actually stored in /etc/shadow.
There exists two special users - the root, which has UID and GID of 0, and the nobody user. The nobody user is an underprivileged user used by some processes to prevent writing on the system.
All processes that have a user ID are also known as pseudo-users.
The /etc/shadow file contains a colon-separated line per user and process, along with encrypted passwords and expiration information. When a user is created or deleted, this file, along with /etc/passwd, are modified.
If the encrypted password shows a
!, then the account is locked. A
!! means that the password has never been set.
A 999999 or -1 specifies that this feature is disabled.
Within this file are a list of shell variables that are defaulted whenever a user is created with the
Here are just some default variables within this file:
SHELL=/bin/sh HOME=/home SKEL=/etc/skel GROUP=100
This file contains a colon-separated list of groups and all its members. Here are its four parameters, all separated by a colon.
This file, much like /etc/shadow, contains information about secure group account information.
The Pragmatic Programmer illustrates the best practices and major pitfalls of many different aspects of software development.Whether you're a new coder, an experienced programmer, or a manager responsible for software projects, use these lessons daily, and you'll quickly see improvements in personal productivity, accuracy, and job satisfaction.$ Check price
The Linux Command Line takes you from your very first terminal keystrokes to writing full programs in Bash, the most popular Linux shell. Along the way you'll learn the timeless skills handed down by generations of gray-bearded, mouse-shunning gurus: file navigation, environment configuration, command chaining, pattern matching with regular expressions, and more.$ Check price