Adding New Users, Storage, File System - PowerPoint PPT Presentation

1 / 13
About This Presentation
Title:

Adding New Users, Storage, File System

Description:

Linux Scheduling : Real Time scheduling Requirement : A real-time process must be given absolute priority. Unix and Linux are both designed for fairness in the ... – PowerPoint PPT presentation

Number of Views:74
Avg rating:3.0/5.0
Slides: 14
Provided by: ASL60
Category:

less

Transcript and Presenter's Notes

Title: Adding New Users, Storage, File System


1
  • Unit-VI
  • Adding New Users, Storage, File System

2
/ETC/PASSWD FILE
  • The system consults /etc/passwd at login time to
    determine a users UID and home directory
  • Each line in the file represents one user and
    contains seven fields separated by colons
  • Login name
  • Encrypted password placeholder
  • UID (user ID) number
  • Default GID (group ID) number
  • GECOS information full name, office,
    extension, home phone
  • Home directory
  • Login shell

3
  • passwd file contains an x in the encrypted
    password field on Linux
  • The actual encrypted passwords are stored in
    etc/shadow on Linux
  • - Login Name Login names (also known as
    usernames) must be unique and, depending on the
    operating system
  • - Encrypted password Encryption algorithms
    traditional
  • crypt (based on DES), MD5, Blowfish, and an
    iterative version of MD5
  • - UID (user ID) number UID identifies the user
    to the system. Login names are provided for the
    convenience of users, but software and the
    filesystem use UIDs internally. UIDs are usually
    unsigned 32-bit integers

4
  • Default GID number Like a UID, a group ID number
    is a 32-bit integer. GID 0 is reserved for the
    group called root or system. /etc/group file
    defines the groups, with the GID field in
    /etc/passwd providing a default (or effective)
    GID at login time
  • - GECOS field GECOS field is sometimes used to
    record personal information about each user. The
    finger command interprets comma-separated GECOS
    entries in the following order
  • Full name (often the only field used)
  • Office number and building
  • Office telephone extension
  • Home phone number

5
  • - Home directoryusers home directory is
    default directory at login time
  • - Login shell The login shell is normally a
    command interpreter such as the Bourne shell or
    the C shell (/bin/sh or /bin/csh), but it can be
    any program. sh is the traditional default for
    UNIX, and bash (the GNU Bourne again shell) is
    the default for Linux

6
/ETC/SHADOW AND /ETC/SECURITY/PASSWD FILES
  • shadow password file is readable only by the
    superuser and serves to keep encrypted passwords
    safe from password cracking programs
  • IBM calls the file that stores the encrypted
    passwords /etc/security/passwd, while the rest of
    the world calls it /etc/shadow
  • Like /etc/passwd, /etc/shadow contains one line
    for each user. Each line contains nine fields,
    separated by colons

7
  • Login name
  • Encrypted password
  • Date of last password change
  • Minimum number of days between password changes
  • Maximum number of days between password changes
  • Number of days in advance to warn users about
    password expiration
  • Linux Days after password expiration that
    account is disabled
  • Account expiration date
  • A reserved field that is currently always empty

8
/ETC/GROUP FILES
  • /etc/group file contains the names of UNIX groups
    and a list of each groups members
  • Each line represents one group and contains four
    fields
  • Name of a group
  • Encrypted password or a placeholder
  • GID number
  • List of members, separated by commas

9
ADDING USERSTHE BASIC STEPS
  • Basic steps to add user by hand
  • Edit the passwd and shadow files to define the
    users account using vipw command.
  • Add the user to the /etc/group file.
  • Set an initial password.
  • Create, chown, and chmod the users home
    directory.

10
ADDING USERS USING USERADD
  • Command
  • sudo useradd user_name g group_name

11
Linux Filesystem
  • Types of linux filetypes are ext2, ext3, ext4
  • Ext3 adds journaling capability to the existing
    ext2 code
  • Ext3 sets aside an area of the disk for the
    journal.
  • When a filesystem operation occurs, the required
    modifications are first written to the journal.
    When the update is complete, a commit record is
    written to mark the end of the entry.
  • If a crash occurs during the update, the
    filesystem uses the journal log to reconstruct a
    perfect consistent filesystem.
  • Journaling reduces the time needed to perform
    filesystem consistency checks
  • To add journal to the existing filesystem
  • tune2fs j /dev/sda1

12
Mkfs,fsck
  • Mkfs- format filsystems
  • General syntax for creating a new filesystem is
  • mkfs T fstype -o options rawdevice
  • fsck ckeck and repair filesystems
  • Filesystem mounting
  • sudo mount /dev/sda1 /mnt/temp

13
Filesystem Terminology
  • Inodes are fixed length table entries that each
    hold information about one file
  • ls i
  • Superblock is a record that describes the
    characteristics of the filesystems.
  • It contains information about the length of a
    disk block, the size and location of the inode
    tables, the disk block map and usage information,
    the size of the block groups
  • Filesystems cache disk blocks to increase
    efficiency
  • Sync system call flushes modified blocks to their
    permanent homes on disk
Write a Comment
User Comments (0)
About PowerShow.com