Sunteți pe pagina 1din 46

c 

 

  
 
 
 c 
 
 
 

r  

‡ Create and manage user and group accounts


‡ View and set access permissions on files and
directories
‡ Understand how file systems are configured and
accessed
‡ Perform basic file compression and archiving
tasks

The Complete Guide to Linux System Administration 2



  


‡ Must first log in using valid user account name


and password
‡ More user accounts on Linux system
± More work required to keep them running
smoothly

The Complete Guide to Linux System Administration 3


  


‡ Preconfigured user accounts


± Root
‡ Administrative account
‡ Also called superuser
‡ Can perform any operation on Linux system
‡ Do not log in as root for normal work
‡ Change temporarily to root user

The Complete Guide to Linux System Administration 4


  
 


 

The Complete Guide to Linux System Administration 5


  
 


 
‡ su command
± Temporarily changes access rights to those of
another user
± Without any parameters
‡ Change to root account
± Hyphen after su command
‡ Causes command to run login scripts
‡ Places you in login directory of user

The Complete Guide to Linux System Administration 6


  
 


 
‡ Preconfigured user accounts
± Regular user accounts
‡ Users who log in at keyboard and use Linux system
‡ Commonly associated with named individuals
± Special user account
‡ Used by Linux programs
‡ Created during installation of Linux
‡ Vary depending on services installed

The Complete Guide to Linux System Administration 7





‡ Group
± Collection of user accounts
± Can be collectively granted access to files and
directories
‡ Each user in Linux is assigned to primary group
‡ /etc/group file
± Lists members of each defined group

The Complete Guide to Linux System Administration 8



 

 

The Complete Guide to Linux System Administration 9



 
‡ /etc/passwd
± Stores user account information
± Password information not stored in this file
± Contents include:
‡ User account name
‡ Password
‡ User ID number (UID)
‡ Group ID number (GID)
‡ User¶s real name
‡ Home directory
‡ Default shell

The Complete Guide to Linux System Administration 10



  

 

‡ /etc/group file
± Defines groups on Linux system
± vigr command
‡ Edit this file
± Contents include:
‡ Name of group
‡ Group password
‡ GID number
‡ Members of group

The Complete Guide to Linux System Administration 11


   ! 

‡ /etc/shadow
± Stores encrypted passwords
± Can only be read by:
‡ Root user
‡ Certain utilities
‡ Shadow password suite
± Collection of password-related programs
± Have been modified to recognize /etc/shadow file

The Complete Guide to Linux System Administration 12


c 

 ! 

‡ Can change password of any user account on


system
± When logged in as root
± Use passwd command
‡ Standard procedure
± System administrator assigns initial password to
new account
± User immediately selects new password

The Complete Guide to Linux System Administration 13


c 

 !  


 
‡ To change user¶s password
± Use passwd without any parameters
± Must enter current password

The Complete Guide to Linux System Administration 14


c 

 !  


 
‡ Good password characteristics
± At least five characters long
± Include digits or punctuation marks
± Mix uppercase and lowercase letters
± Easy for account owner to remember
± Hard for anyone else to guess
± Not created from simple manipulation of:
‡ Word found in dictionary
‡ Name of person or place

The Complete Guide to Linux System Administration 15


"
 
c

‡ id command
± Shows effective UID
‡ logname command
± View user name that you used to log in
‡ whoami command
± Shows user name of currently effective UID
‡ groups command
± Lists all groups you are a member of

The Complete Guide to Linux System Administration 16


"
 
c



 
‡ who command
± Lists all regular users on system
± Shows location where they are logged in
‡ w command
± Information from who command, plus:
‡ Time person logged in
‡ Program they are running
‡ Information about system resources user is
consuming

The Complete Guide to Linux System Administration 17


 ! 

‡ Files and directories have


± Owner
± Group
‡ Linux determines who can access file or directory
based on:
± Who owner is
± Which group is assigned to object
‡ File permissions define access granted to file or
directory

The Complete Guide to Linux System Administration 18


 ! 


 
‡ Access mode
‡ Permissions
± Read permission (r)
± Write permission (w)
± Execute permission (x)
‡ Permissions can be assigned by:
± User permissions
± Group permissions
± Other permissions

The Complete Guide to Linux System Administration 19


 ! 


 

The Complete Guide to Linux System Administration 20


c 

r
 
‡ chown command
± Change user and group assigned to file or
directory
± Can only use when logged in as root
± Example: chown jtaylorManagers report.doc
‡ Can use graphical file manager to change owner
of file
‡ chgrp command
± Change group assigned to file or directory
± Example: chgrp managers report.doc

The Complete Guide to Linux System Administration 21


c 

 ! 

‡ chmod (change mode) command


± Change file permissions
± Regular users can alter permissions assigned to
any file or directory that you own
± Example: chmod o+w reportDoc
± System administrators normally use shortcut
syntax

The Complete Guide to Linux System Administration 22


c 

 ! 



 
‡ Alternate syntax
± Each of sets of three permissions is represented
by number from 0 to 7
± Example: chmod 640 report.doc
‡ Graphical environment provides easy method of
setting file permissions
± Properties dialog box
± Permissions tab

The Complete Guide to Linux System Administration 23


c 

 ! 



 

The Complete Guide to Linux System Administration 24


c 

 ! 



 

The Complete Guide to Linux System Administration 25


( ! 

‡ rw-rw-rw-
‡ umask command
± Defines mask to stop certain permissions from
being granted by default when files created
± Executed automatically when you log in to Linux
± Uses same three-digit permission codes as chmod
command

The Complete Guide to Linux System Administration 26


"
 
   

‡ Managing file system is basic task for system


administrators

The Complete Guide to Linux System Administration 27


!  

  

‡ Partition
± Distinct area of hard disk
± Has been prepared to store particular type of data
‡ File system
± Arrangement of information on device such as
hard disk
‡ df command
± See status of all currently accessible file systems

The Complete Guide to Linux System Administration 28


!  

   


 
‡ Linux typically uses one of two default file system
types:
± ext3
± Reiserfs

The Complete Guide to Linux System Administration 29


!  

   


 

The Complete Guide to Linux System Administration 30


"
  

#
‡ inode
± Hold information about files
± Within ext2 or ext3 file system
± Has associated number
± Controls file to which it points
± Does not contain file name
‡ File record contains:
± File name
± Inode number for file

The Complete Guide to Linux System Administration 31


"
  

# 

 
‡ Directory record contains list of files with
corresponding inode numbers
‡ Link allows two or more file records to refer to
same physical data stored in file system
‡ Symbolic link
± File that refers to another file or directory, rather
than containing data itself
± Used when same data must be accessed from two
locations in directory structure
± Takes only a few bytes of hard disk space

The Complete Guide to Linux System Administration 32


"
  

# 

 
‡ ln command
± Create symbolic link
± Use -s option
± Syntax: ln -s <existing file> <symbolic link to be
created>
‡ Hard link
± File record that includes file name and inode
± Just like regular file record
± Refers to inode that already has file record
pointing to it

The Complete Guide to Linux System Administration 33


"
  

# 

 

The Complete Guide to Linux System Administration 34


"
  

# 

 

The Complete Guide to Linux System Administration 35


 

‡ Different types of files are used to perform


different functions
‡ Stat command
± Ties together file name with inode
± Shows information about inode

The Complete Guide to Linux System Administration 36


  

 

The Complete Guide to Linux System Administration 37



$ % 
‡ To use any file system
± Must be mounted
‡ Mount command
± Instruct Linux how to access file system
‡ Mount point
± Path in directory structure where you access data
in file system
‡ umount command
± unmount media

The Complete Guide to Linux System Administration 38



$ % 


 
‡ fdformat command
± Format 3.5-inch disk
‡ /dev/fd0
± Device name for 3.5-inch disk drive

The Complete Guide to Linux System Administration 39





‡ find command
± Helps find objects matching exact search criteria
± Doesn¶t use prebuilt index
± Example: find /home -name "report.doc" -print

The Complete Guide to Linux System Administration 40


%

  

‡ System administrators often work with files that


include:
± Compressed data
± Multiple files in archival format

The Complete Guide to Linux System Administration 41


c
 

‡ Compressing files
± Useful way to use less space for rarely accessed
data
± Makes files smaller before transmitting them over
network
‡ gzip command
± Compress any file
‡ gunzip command
± Uncompresses file compressed using gzip

The Complete Guide to Linux System Administration 42




 
 
 
‡ tar archive
± Single file that can contain other files and directory
structure
‡ tar command
± Create tar archive
± Specify files to be included in backup archive on
command line
± Writes data to file name or device

The Complete Guide to Linux System Administration 43




  

  

 
‡ cpio command
± Copy in and out
± Similar to tar
± Reads from STDIN channel for file names
± Writes data back to STDOUT
‡ tar and cpio
± Help create incremental or multilevel backup

The Complete Guide to Linux System Administration 44




‡ User accounts form basis of file system security


in Linux
‡ Can change user that you are working as
‡ Each user can belong to multiple Linux groups
‡ Encrypted passwords are stored in
/etc/shadow file
‡ Linux file security is controlled by nine
permissions

The Complete Guide to Linux System Administration 45




 
‡ File systems
± Organized collections of data
± Created within partitions on hard disk
‡ Hard and soft links
± Refer to inode
‡ Removable media must be mounted before it can
be accessed
‡ Linux includes several utilities for compressing
files

The Complete Guide to Linux System Administration 46

S-ar putea să vă placă și