Users, Groups, Passwords



To check the users that have been created on the system:

=> cat /etc/passwd

Columns in the /etc/passwd ->

a) username

b) placeholder for passwd

c) user id (uid)

d) group id (gid)

e) comment or description

f) home directory

g) login shell



To check the groups existing on the system:

=> cat /etc/group (contains groupname and gid)



The file that contains encrypted passwords:

=> /etc/shadow

The columns of /etc/shadow are mentioned in "man 5 shadow".



The file that has the password policy settings, the min. and max.

UID/GID setting for users and groups that are created, settings

to prevent a user's home directory from being created.

=> /etc/login.defs



To see the current password policy for a user:

=> chage -l (e.g chage -l abg)

To change the password policy for a user:

=> chage (e.g. chage abg)


F] Troubleshooting:

What if the /etc/shadow file gets deleted?

You won't be able to login, so what is the solution?

=> Boot into runlevel 1 (here password is not reqd. to login)

=> cd /etc

=> pwconv passwd (The /etc/shadow file will get created)

(Although the /etc/shadow file is created, the passwords won't


=> Reset the root password










Login Shells and Startup Scripts


To see the different available shells:

=> cat /etc/shells




Files that print Pre-login Messages before the login prompt

1. /etc/motd (motd => message of the day)

2. /etc/issue




Order of Execution of Startup Scripts

A Login shell first calls the /etc/profile script. The actual

order is as follows:

1. /etc/profile

2. /etc/profile.d where profile.d is a directory

3. ~/.bash_profile

4. ~/.bashrc

5. /etc/bashrc

Almost all the variables that can be seen using "set" and "env"

commands are set in '.bash_profile' and not '.bashrc'

Only aliases are set in '.bashrc'





The kill command signals


To see a list of signals and their values that are to be used with

the "kill" command:

=> man 7 signal



The kernel


To dynamically make changes to the kernel:

1. /etc/sysctl.conf

2. sysctl -p (to update) (sysctl -e for errors)

NB:  a) For a complete list of sysctl parameters, use "sysctl -a".

       b) Changes to the /proc filesystem are temporary & if you want them to persist 

           across reboots, put an entry in /etc/sysctl.conf

       c) Also, you can check /proc/sys/net ... and its sub-directories.



To see the kernel version:

1. ls /lib/modules (modules is a directory)

2. cat /proc/version

3. uname -r



The Boot Process


Boot/Initialization files

1. /etc/grub.conf (kernel /vmlinuz-.... & initrd lines)

2. /etc/fstab

3. /boot/vmlinuz.... & /lib/modules (Kernel Initialization)

4. /etc/inittab (init process),

(to set default runlevel and increase tty's)

5. /etc/rc.d/rc.sysinit (rc.sysinit calls /etc/sysctl.conf)

6. /etc/rc.d/rc?.d (where ? is from 0 to 6 as per the runlevel &

rc?.d are script directories)

7. /etc/rc.d/rc.local



Summing up the Boot Steps:

1. BIOS Initialization

2. Boot Loader

3. Kernel Initialization

4. Top-most process init

5. Entering the desired runlevel




The mount command


The file used by the mount command:

=> /etc/mtab


Mounting the Filesystem


To mount the different filesystems automatically when the system starts:

This is done by /etc/fstab

Columns of /etc/fstab include:

a) LABEL or device

b) Mountpoint

c) Filesystem type

d) Mount Options (async, rw, nouser, quotas, suid,.....)

e) Dump frequency (0 => no frequency, 1 => dump once every day)

                           (2 => dump once in two days)

f) Filesystem Checking Order (0 => do not check, 1 => 1st root)

                                        (2 => check next, 2nd = boot, home, usr, ...)

After creating a filesystem, make an entry in the /etc/fstab file

to mount the filesystem every time the system starts.



Partition Information (Hard disk, CPU and RAM)


To see the partition information:

1. cat /proc/partitions

2. fdisk -l (also shows fstype, system_id, start


Verlag: BookRix GmbH & Co. KG

Tag der Veröffentlichung: 25.05.2014
ISBN: 978-3-7368-1457-8

Alle Rechte vorbehalten

The book is dedicated to all the Linux users across the world as well as those who are new to Linux.

Nächste Seite
Seite 1 /