190 likes | 318 Vues
This chapter covers essential Linux administration tasks focusing on user and group configuration, file backup strategies, and system reporting tools. Learn how to efficiently add and remove users and groups using command-line tools like `useradd` and `groupadd`, as well as GUI methods. Explore file backup methods including tar and cpio, understanding full vs. incremental backups, and scheduling tasks using 'at' command or KCron. Gain insights into system reports generated by utilities like vmstat and top, and effective communication methods with users using Write and Wall commands.
E N D
Linux Admin Tasks Chapter 16
This Chapter • User and group config • Backing up files • System reports • Keeping users informed • Speeding up the system
User and Group Configuration • Adding a user through the command line • useradd –g {group} –c “UsersFullName” UserName • useradd –g sales –c “Joe Javahead” Joe
Adding a user through GUI • System-config-users
Manipulating users accounts • Removing a user through command prompt • userdel –r UserName • userdel -r Joe • “-r” will remove all user files and his home directory • Adding a user group • groupadd –g {assigned group ID} GroupName • groupadd –g 3737 Sales • groupmod can be used to change group name
Backing Up Files • Full vs. incremental • Medium • Tape • DVD • Swappable media • SAN / NAS
Backup Utils • tar – tape archive • cpio – copy in / copy out
tar • Tar is used to pack the entire contents of a directory or directories into a single file called a tarball which can then be backed up to tape, gzipped and saved, or transferred to another system • The most commonly used tar functions are: • c - create an archive • x - extract files from an archive • t - list the contents of an archive • v - verbose (output to screen) • f filename - use the specified file • z - gzip/gunzip
tar – cont’d • Back up the contents of the home directory for Joe (/home/Joe) in a tarball called Joe.tar on a floppy disk.Options: Create archive, verbose, use specified file name: mount /floppycd /hometar -cvf /floppy/Joe.tar Joe
cpio • Similar to tar, but has a wider variety of archive formats • cpio {-o/-i} filenames device • cpio –o archive.gz;archive2.gz /dev/cdrom
Scheduling Tasks • “at” command • Execute commands at a specified time and optional date. The commands are read from standard input or from a file. • at {time} {day/date} then specify job • at 15:30 wed [ENTER] • At>./cleanup • At> press ctrl +D to end process
GUI Task Schedule • KCron is an application for scheduling programs to run in the background. It is a graphical user interface to cron, the UNIX system scheduler • When KCron starts you will see a summarized view of existing scheduled tasks and associated environment variables
System Reports • You can use various utilities we have already covered to collect information about the system: who, finger, ls, ps, etc • Vmstat can be used to report on virtual memory status. • Top will report heaviest use processes • Sar (System Activity Report) give a snapshot of the systemresources( sysstat package)
Communicating to users • Write • Utility allows you to communicate with a single user that is logged onto the local system. Users can use it to write back • Wall • Utility that allows the Admin to send a one-way communication to all logged in users • Wall the building is on fire
Keeping the system humming • In the unlikely event of a loss of cabin pressure oxygen masks will drop form the compartments above. • Equally unlikely is a hung program on a Linux machine. When it does happen you can use the kill command to get rid of that program.
Kill • Use top to find the process ID for the offending program • Use kill PID to stop the program • Kill 3014
This Chapter • User and group config • Backing up files • System reports • Keeping users informed • Speeding up the system