130 likes | 147 Views
Unit-VI Adding New Users, Storage, File System. The system consults /etc/passwd at login time to determine a user’s UID and home directory Each line in the file represents one user and contains seven fields separated by colons: • Login name • Encrypted password placeholder
E N D
Unit-VI Adding New Users, Storage, File System
The system consults /etc/passwd at login time to determine a user’s 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 /ETC/PASSWD FILE
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
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
- Home directory:user’s 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
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, whilethe 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: /ETC/SHADOW AND /ETC/SECURITY/PASSWD FILES
• 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
/etc/group file contains the names of UNIX groups and a list of each group’s 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 /ETC/GROUP FILES
Basic steps to add user by hand • Edit the passwd and shadow files to define the user’s account using vipw command. • Add the user to the /etc/group file. • Set an initial password. • Create, chown, and chmod the user’s home directory. ADDING USERS:THE BASIC STEPS
Command: $ sudo useradd user_name –g group_name ADDING USERS USING USERADD
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 Linux Filesystem
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 Mkfs,fsck
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 Filesystem Terminology