Redhat Basic. Need. Your. What. Operation G U I D E. Technical Hand Note template version

Similar documents
Chapter 5: User Management. Chapter 5 User Management

NETW 110 Lab 5 Creating and Assigning Users and Groups Page 1

10 userdel: deleting a user account 9. 1 Context Tune the user environment and system environment variables [3]

User accounts and authorization

RedHat. Rh202. Redhat Certified Technician on Redhat Enterprise Linux 4 (Labs)

User Accounts. The Passwd, Group, and Shadow Files

RH-202. RedHat. Redhat Certified Technician on Redhat Enterprise Linux 4 (Labs)

MANAGING THE NONUNIFORM BEHAVIOUR OF TERMINALS AND KEYBOARDS. : WHEN THINGS GO WRONG

Linux+ Guide to Linux Certification, Third Edition. Chapter 2 Linux Installation and Usage

CST8207: GNU/Linux Operating Systems I Lab Seven Linux User and Group Management. Linux User and Group Management

User & Group Administration

CSE 265: System and Network Administration

CST8207: GNU/Linux Operating Systems I Lab Seven Linux User and Group Management. Linux User and Group Management

Installation of Fedora 12 with CD

Red Hat Operating System Installation Tips

Critical Analysis and last hour guide for RHCSA/RHCE Enterprise 7

Installing Linux on JMU Computer-Science Department Removable Hard Drives for CS-450 and CS-550

RH133. Red Hat Linux System Administration

Getting Started with OpenSolaris An Introduction for Technical Evaluators

Certification. RPM, Boot Loaders, and Kickstart

Lab 2A> ADDING USERS in Linux

Q) Q) What is Linux and why is it so popular? Answer - Linux is an operating system that uses UNIX like Operating system...

Fedora Core: Made Simple

OPERATING SYSTEMS LINUX

Parallels Server 5 Bare Metal

Accurate study guides, High passing rate! IT TEST BOOK QUESTION & ANSWER. Ittestbook provides update free of charge in one year!

Commands are in black

3 INSTALLING WINDOWS XP PROFESSIONAL

Installing and Upgrading Cisco Network Registrar Virtual Appliance

Digipass Plug-In for SBR. SBR Plug-In SBR. Steel-Belted RADIUS. Installation G uide

Parallels Server 4.0 for Mac Bare Metal Edition

Virtual CD TS 1 Introduction... 3

Introduction. What is Linux? What is the difference between a client and a server?

How to Use This Lab Manual

IT Essentials v6.0 Windows 10 Software Labs

The kernel is the low-level software that manages hardware, multitasks programs, etc.

Users and Groups. his chapter is devoted to the Users and Groups module, which allows you to create and manage UNIX user accounts and UNIX groups.

Using UCS-Server Configuration Utility

Basic Linux Security. Roman Bohuk University of Virginia

Linux Kung Fu. Stephen James UBNetDef, Spring 2017

Exam Questions RH133

INSTALLING INSTALLING INSTALLING

Installing the CGDS - Substation Workbench Server Software

Upgrade Tool Guide. July

SANS Institute - Operations Essentials. Operating System Installation Guidelines. Windows XP Professional Installation. Creating Boot Disks

Ubuntu Supplement to X350 & X550 User s Guide NComputing X350 & X550 vspace Software for Linux on Ubuntu 8.04

SysadminSG RHCSA Study Guide

Exam Questions RH302

UNIT 10 Ubuntu Security

Contents. Getting Started...1. Managing Your Drives...9. Backing Up & Restoring Folders Synchronizing Folders...52

Contents at a Glance COPYRIGHTED MATERIAL. Introduction...1 Part I: Becoming Familiar with Enterprise Linux...7

Build your own NAS with OpenMediaVault

1Z Oracle Linux 6 Implementation Essentials Exam Summary Syllabus Questions

Linux VPN Configuration

Acronis Backup Version 11.5 Update 6 INSTALLATION GUIDE. For Linux Server APPLIES TO THE FOLLOWING PRODUCTS

1Z Oracle Linux 5 and 6 System Administration Exam Summary Syllabus Questions

Exam LFCS/Course 55187B Linux System Administration

Please choose the best answer. More than one answer might be true, but choose the one that is best.

User Management. René Serral-Gracià Xavier Martorell-Bofill 1. May 26, Universitat Politècnica de Catalunya (UPC)

Clearswift SECURE Gateway Installation & Getting Started Guide. Version Document Revision 1.0

Downloading and installing Db2 Developer Community Edition on Ubuntu Linux Roger E. Sanders Yujing Ke Published on October 24, 2018

CST8207: GNU/Linux Operating Systems I Lab Ten Boot Process and GRUB. Boot Process and GRUB

Amahi Instruction Manual

Installing MySQL Database On Linux

Clearswift SECURE Gateway Installation & Getting Started Guide. Version 4.3 Document Revision 1.0

Downloading and installing Db2 Developer Community Edition on Red Hat Enterprise Linux Roger E. Sanders Yujing Ke Published on October 24, 2018

UNIT V. Dr.T.Logeswari. Unix Shell Programming - Forouzan

CIT 470: Advanced Network and System Administration. Topics. Namespaces. Accounts and Namespaces. 1. Namespaces 2. Policies

Architect Userís Guide

Silk Performance Manager Installation and Setup Help

Linux Interview Questions and Answers

IBM Hyper-Scale Manager as an Application Version 1.7. User Guide GC

EvaluNet XT v1.2. Setup Guide

Unified CCX Upgrade. Unified CCX Upgrade Types. This chapter explains how to upgrade Unified CCX.

Unit 2: Manage Files Graphically with Nautilus Objective: Manage files graphically and access remote systems with Nautilus

Installing caos with Cinch on Floppy Disk

Web Console Setup & User Guide. Version 7.1

Network Drawing. Computer Specs, I ve used. Installing a Network-Based Intrusion Detection

User s Guide February 28, 2017

Lesson 1: Preparing for Installation

Production Installation and Configuration. Openfiler NSA

System Administration

Linux Home Lab Environment

Clearswift SECURE Gateway Installation & Getting Started Guide. Version Document Revision 1.0

CounterACT User Directory Plugin

This is Lab Worksheet/Installation 7

This is Lab Worksheet 7 - not an Assignment

Installing FreePBX Official Distro

QuickStart Guide for Managing Computers. Version 9.73

At course completion. Overview. Audience profile. Course Outline. : 55187B: Linux System Administration. Course Outline :: 55187B::

INSTALLING INSTALLING INSTALLING

DUAL OS INSTALLATION

Transport Gateway Installation / Registration / Configuration

Ubuntu installation alongside windows 8/8.1 and 10

Clearswift Gateway Installation & Getting Started Guide. Version 4.1 Document Revision 1.4

Actual4Test. Actual4test - actual test exam dumps-pass for IT exams

Version 11. NOVASTOR CORPORATION NovaBACKUP

"Charting the Course... MOC B: Linux System Administration. Course Summary

QuickStart Guide for Managing Computers. Version 9.32

7. Try shrinking / -- what happens? Why? Cannot shrink the volume since we can not umount the / logical volume.

Transcription:

Redhat Basic Operation G U I D E What Need Your www.next-asia.com Readhat Basic Operation Guide, Prepared by Nazmul Khan Page 1 of 43

Redhat Basic Operation Guide RedHat Installation Guide... 2 Installation... 2 Post Installation Configuration... 10 Managing Users via the User Manager application... 14 Viewing Users... 14 Adding a New User... 16 Modifying User Properties... 18 Viewing Groups... 19 Adding a New Group... 20 Modifying Group Properties... 21 Managing Users via Command-Line Tools... 22 Creating Users... 22 Attaching New Users to Groups... 24 Updating Users' Authentication... 25 Deleting Users... 27 Displaying Comprehensive User Information... 28 Managing Groups via Command-Line Tools... 32 Creating Groups... 32 Attaching Users to Groups... 34 Updating Group Authentication... 35 Modifying Group Settings... 36 Deleting Groups... 36 Additional Commands... 37 Installed Documentation... 37 Using RPM... 38 Finding RPM Packages... 38 Installing RPM Packages... 38 Un-installing RPM Packages... 39 Upgrading RPM Packages... 39 Freshening RPM Packages... 40 Querying RPM Packages... 41 Verifying RPM Packages... 42 Readhat Basic Operation Guide Page 1 of 43

RedHat Installation Guide As the open source revolution grows around the world, more and more people are starting to switch over to the Linux Operating System and pre-eminent of all the Linux OS is the Red Hat Linux, owned and distributed by the Red Hat Inc. However, installation of Linux itself is seen as a rather arduous and herculean task among many beginners/inexperienced users. As a result this document has been formulated as a step-by-step guide to ensure that everybody can install and use Red Hat Linux seamlessly and with ease. So lets start the installation, here are the steps to easily install red hat linux : Installation Step 1 Insert the Red Hat Linux DVD into the DVD-drive of your computer. As soon as the following screen pops up, press Enter to install Red Hat Enterprise Linux (RHEL) through GUI mode. Step 2- RHEL installer would then prompt you conduct a check as to whether the CD media from which you re installing is functioning correctly or not. Choose Skip, press enter and the installation would begin. Readhat Basic Operation Guide Page 2 of 43

Step 3- Next, we need to select the language- English or any other language as per your preference, and then press Next. Step 4- In this step, the RHEL installer would ask you about the appropriate type of keyboard for the system. We take the US English keyboard, you can pick any other option depending on the type of your keyboard. Then press Next to move to the next step. Step 5- Next, the installer would ask for an installation number if you wish to install full set of Red Hat functionalities. Enter the installation number and press OK if you have an officially licensed installation number(for corporate clients that buy Red Hat s backup support and full features). Others can select Skip entering installation number and press OK to proceed. RHEL would show a warning message, press Skip in it to continue. Readhat Basic Operation Guide Page 3 of 43

Step 6- The Red Hat installer would then require you to create partitions in your computer s hard disk for the installation. You can do it in four ways but the simplest way is to select Use free space on selected drives and create default layout as this option will not affect any other OS residing in your system. Check the review and modify portioning layout to create partitions and click next. Step 7- In this step you must create the required system partitions and mount points such as /boot, /home, swap etc which are required for the Linux s proper functioning. To create different partitions such as /home, /var etc, click on New to create the partitions. Readhat Basic Operation Guide Page 4 of 43

Then, select /home in the mount point and choose ext3 as the file system and give the desired size for it and then click OK. Similarly also create /boot and /var. Also, create a swap partition by clicking on New and then choosing the filesystem as swap and also give the size of Swap partition.(usually size of swap partition SHOULD BE twice the size of RAM available to the system but you can keep its size less than that too) Readhat Basic Operation Guide Page 5 of 43

Once you have made all the desired partitions and given their mount points, click Next to continue installation. Step 8- This step pertains to the default OS that will be loaded by the GRUB loader Readhat Basic Operation Guide Page 6 of 43

(Note- If you have multiple Operating Systems installed, you would see multiple options here and you have to check in front of the OS name that you want to be loaded by default when the system is started.) Click Next to continue. Step 9- This step pertains to the network settings of the Linux system that you are going to install. You can select the Ethernet devices through which the system would communicate with other devices in the network. You can also provide the hostname, Gateway address and DNS address to the system during this step. (However it s better to adjust these settings once the system has been fully installed). Step 10- The next step is to adjust the system clock to your particular time zone. Select your time zone and then click Next. Readhat Basic Operation Guide Page 7 of 43

Step 11 This is a very important step that deals with the root(super-user) password for the system. Type the password and confirm it and then click next. Step 12 The RHEL installer would then prompt you about if you wish to install some extra Software Development or Web Server features. By default, keep it at Customize later and press Next. Readhat Basic Operation Guide Page 8 of 43

Step 13- This next step will initiate the installation of Red Hat Linux, press Next to begin the process. Step 14- Upon the completion of installation you should the following screen. Press Reboot and you d be ready to use your newly installed Red Hat Linux OS. Readhat Basic Operation Guide Page 9 of 43

Post Installation Configuration 1. Accept the Red Hat License agreement and click Forward. 2. The next step is regarding the configuration of the Firewall. You can Enable or Disable the firewall according to your preferences and then click Forward. Readhat Basic Operation Guide Page 10 of 43

3. Next step is about the configuration of another security tool- SE Linux. By default you should keep it Disabled unless you re working with very secure information. 4. You can also choose to configure the Kdump, that stores information about system crashes if your system fails but uses valuable disk space. By default don t enable it. Readhat Basic Operation Guide Page 11 of 43

5. Next, adjust the time and date settings, and then click Forward. 6. The next step is for software updates from Red Hat, at this point you should skip the registration and register at a later time and then click Forward. 7. This step is to create a non-admin user for the system. Enter the details and click Forward. Readhat Basic Operation Guide Page 12 of 43

8. This step is about configuration of your Sound Card, choose a sound device and then click Forward. 9. Click Forward to complete the configurations and start using your Red Hat Linux OS. (Note- On clicking Finish the system would require a reboot if you have made changes to the configurations of Firewall or SE Linux.) Readhat Basic Operation Guide Page 13 of 43

Your Red Hat Linux OS is now all installed and configured, ready to be used. Now let s share some Basic Redhat Administration task. Managing Users via the User Manager application The User Manager application allows you to view, modify, add, and delete local users and groups in the graphical user interface. To start the User Manager application: From the toolbar, select System Administration Users and Groups. Or, type system-config-users at the shell prompt. Viewing Users In order to display the main window of the User Manager to view users, from the toolbar of User Manager select Edit Preferences. If you wish to view all the users, that is including system users, clear the Hide system users and groups checkbox. The Users tab provides a list of local users along with additional information about their user ID, primary group, home directory, login shell, and full name. Readhat Basic Operation Guide Page 14 of 43

Readhat Basic Operation Guide Page 15 of 43

Adding a New User If there is a new user you need to add to the system, follow this procedure: 1. Click the Add User button. 2. Enter the user name and full name in the appropriate fields 3. Type the user's password in the Password and Confirm Password fields. The password must be at least six characters long. 1. Select a login shell for the user from the Login Shell dropdown list or accept the default value of /bin/bash. 2. Clear the Create home directory checkbox if you choose not to create the home directory for a new user in /home/username/. You can also change this home directory by editing the content of the Home Directory text box. Note that when the home directory is created, default configuration files are copied into it from the /etc/skel/ directory. 3. Clear the Create a private group for the user checkbox if you do not want a unique group with the same name as the user to be created. User private group (UPG) is a group assigned to a user account to which that user exclusively belongs, which is used for managing file permissions for individual users. 4. Specify a user ID for the user by selecting Specify user ID manually. If the option is not selected, the next available user ID above 500 is assigned to the new user. 5. Click the OK button to complete the process. Readhat Basic Operation Guide Page 16 of 43

Look at the sample Add New User dialog box configuration: To configure more advanced user properties, such as password expiration, modify the user's properties after adding the user. Readhat Basic Operation Guide Page 17 of 43

Modifying User Properties 1. Select the user from the user list by clicking once on the user name. 2. Click Properties from the toolbar or choose File Properties from the dropdown menu. 3. There are four tabs you can update to your preferences. When you have finished, click the OK button to save your changes. Readhat Basic Operation Guide Page 18 of 43

Managing Groups via the User Manager Application Viewing Groups In order to display the main window of User Manager to view groups, from the toolbar select Edit Preferences. If you wish to view all the groups, clear the Hide system users and groups checkbox. The Groups tab provides a list of local groups with information about their group ID and group members as you can see in the picture below. Readhat Basic Operation Guide Page 19 of 43

Adding a New Group If there is a new group you need to add to the system, follow this procedure: 1. Select Add Group from the User Manager toolbar: 2. Type the name of the new group. 3. Specify the group ID (GID) for the new group by checking the Specify group ID manually checkbox. 4. Select the GID. Note that Red Hat Enterprise Linux also reserves group IDs lower than 500 for system groups. 5. Click OK to create the group. The new group appears in the group list. Readhat Basic Operation Guide Page 20 of 43

Modifying Group Properties 1. Select the group from the group list by clicking on its name. 2. Click Properties from the toolbar or choose File Properties from the dropdown menu. 3. The Group Users tab displays the list of group members. Use this tab to add or remove users from the group. Click OK to save your changes. Readhat Basic Operation Guide Page 21 of 43

Managing Users via Command-Line Tools When managing users via command line, the following commands are used: useradd, usermod, userdel, or passwd. The files affected include /etc/passwd which stores user accounts information and /etc/shadow, which stores secure user account information. Creating Users The useradd utility creates new users and adds them to the system. Following the short procedure below, you will create a default user account with its UID, automatically create a home directory where default user settings will be stored, /home/username/, and set the default shell to /bin/bash. Example Creating a User with Default Settings Readhat Basic Operation Guide Page 22 of 43

If you want to change the basic default setup for the user while creating the account, you can choose from a list of command-line options modifying the behavior of useradd (see the useradd(8) man page for the whole list of options). As you can see from the basic syntax of the command, you can add one or more options: Example Specifying a User's Full Name when Creating a User If you do not want to create the home directory for the user at all, you can do so by running useradd with the -M option. However, when such a user logs into a system that has just booted and their home directory does not exist, their login directory will be the root directory. If such a user logs into a system using the su command, their login directory will be the current directory of the previous user. Readhat Basic Operation Guide Page 23 of 43

Attaching New Users to Groups The useradd command creates a User Private Group (UPG, a group assigned to a user account to which that user exclusively belongs) whenever a new user is added to the system and names the group after the user. For example, when the account robert is created, an UPG named robert is created at the same time, the only member of which is the user robert. If you do not want to create a User Private Group for a user for whatever reason, execute the useradd command with the following option: Instead of automatically creating UPG or not creating it at all, you can specify the user's group membership with -g and -G options. While the -g option specifies the primary group membership, -G refers to supplementary groups into which the user is also included. The group names you specify must already exist on the system. Example Adding a User to a Group The useradd -g "friends" -G "family,schoolmates" emily command creates the user emily but emily's primary group is set to friends as specified by the -g option. emily is also a group member of the supplementary groups family and schoolmates. Provided the user already exists and you want to add them to certain supplementary group(s), use the usermod command with the -G option and a list of groups divided by commas, no spaces: Readhat Basic Operation Guide Page 24 of 43

Updating Users' Authentication Password Policy Password/Account Policy Setting Set Password Expiration Days Set Password Change Minimum Number of Days Set Password Expiring Warning Days 90 Days 5 days 15 days When running the basic useradd username command, the password is automatically set to never expire (see the /etc/shadow file). If you wish to change this, use passwd, the standard utility for administering the /etc/passwd file. The syntax of the passwd command look as follows: You can, for example, lock the specified account. The locking is performed by rendering the encrypted password into an invalid string by prefixing the encrypted string with an the exclamation mark (!). If you later find a reason to unlock the account, passwd has a reverse operation for locking. Only root can carry out these two operations. Unlocking a User Password At first, the -l option locks robert's account password successfully. However, running the passwd -u command does not unlock the password because by default passwd refuses to create a passwordless account. If you wish a password for an account to expire, run passwd with the -e option. The user will be forced to change the password during the next login attempt: Readhat Basic Operation Guide Page 25 of 43

As far as the password lifetime is concerned, setting the minimum time between password changes is useful for forcing the user to really change the password. The system administrator can set the minimum (the -n option) and the maximum (the -x option) lifetimes. To inform the user about their password expiration, use the -w option. All these options must be accompanied with the number of days and can be run as root only. Example Adjusting Aging Data for User Passwords The above command has set the minimum password lifetime to 10 days, the maximum password lifetime to 60, and the number of days jane will begin receiving warnings in advance that her password will expire to 3 day. Later, when you cannot remember the password setting, make use of the -S option which outputs a short information for you to know the status of the password for a given account: You can also set the number of days after a password expires with the useradd command, which disables the account permanently. A value of 0 disables the account as soon as the password has expired, and a value of -1 disables the feature, that is, the user will have to change his password when the password expires. The -f option is used to specify the number of days after a password expires until the account is disabled (but may be unblocked by system administrator): For more information on the passwd command see the passwd(1) man page. Readhat Basic Operation Guide Page 26 of 43

Deleting Users If you want to remove a user account from the system, use the userdel command on the command line as root. Combining userdel with the -r option removes files in the user's home directory along with the home directory itself and the user's mail spool. Files located in other file systems have to be searched for and deleted manually. Readhat Basic Operation Guide Page 27 of 43

Displaying Comprehensive User Information When administering users and groups on your system, you need a good tool to monitor their configuration and activity on the system. Red Hat Enterprise Linux 6 provides you with the lslogins command-line utility, which gives you comprehensive overview about users and groups, not only regarding user or group account configuration but also their activity on the system. The general syntax of lslogins is the following: where OPTIONS can be one or more available options and their related parameters. See the lslogins(1) manual page or the output of the lslogins --help command for the complete list of available options and their usage. The lslogins utility gives versatile information in a variety of formats in dependency on the chosen options. The following examples introduce the most basic as well as some of the most useful combinations. Running the lslogins command without any options shows default information about all system and user accounts on the system. Specifically, their UID, user name, and GECOS information, as well as information about the user's last login to the system, and whether their password is locked or login by password disabled. Readhat Basic Operation Guide Page 28 of 43

Example Displaying basic information about all accounts on the system To display detailed information about a single user, run the lslogins LOGIN command, where LOGIN is either UID or a user name. The following example displays detailed information about John Doe's account and his activity on the system: Readhat Basic Operation Guide Page 29 of 43

Example Displaying detailed information about a single account If you use the --logins=login, you can display information about a group of accounts that are specified as a list of UIDs or user names. Specifying the --output=columns option, where COLUMNS is a list of available output parameters, you can customize output of the lslogins command. For example, the following command shows login activity of the users root, jsmith, jdoe, and esmith: Example Displaying specific information about a group of users The lslogins utility also distinguishes between system and user accounts. To address system accounts in your query, use the --system-accs option. To address user accounts, use the --user-accs. For example, the following command displays information about supplementary groups and password expiration for all user accounts: Readhat Basic Operation Guide Page 30 of 43

Example Displaying information about supplementary groups and password expiration for all user accounts Jul21/02:00 Possibility to format the output of lslogins commands according to user's needs makes lslogins an ideal tool to use in scripts and for automatic processing. For example, the following command returns a single string that represents the time and date of the last login. This string can be passed as input to another utility for further processing. Example Displaying a single piece of information without the heading Readhat Basic Operation Guide Page 31 of 43

Managing Groups via Command-Line Tools Groups are a useful tool for permitting co-operation between different users. There is a set of commands for operating with groups such as groupadd, groupmod, groupdel, or gpasswd. The files affected include /etc/group which stores group account information and /etc/gshadow, which stores secure group account information. Creating Groups To add a new group to the system with default settings, the groupadd command is run at the shell prompt as root. Example Creating a Group with Default Settings The groupadd command creates a new group called friends. You can read more information about the group from the newly-created line in the /etc/group file: Automatically, the group friends is attached with a unique GID (group ID) of 30005 and is not attached with any users. Optionally, you can set a password for a group by running gpasswd groupname. Alternatively, you can add command options with specific settings. If you, for example, want to specify the numerical value of the group's ID (GID) when creating the group, run the groupadd command with the -g option. Remember that this value must be unique (unless the -o option is used) and the value must be non-negative. Readhat Basic Operation Guide Page 32 of 43

Example Creating a Group with Specified GID The command below creates a group named schoolmates and sets GID of 60002 for it: When used with -g and GID already exists, groupadd refuses to create another group with existing GID. As a workaround, use the -f option, with which groupadd creates a group, but with a different GID. You may also create a system group by attaching the -r option to the groupadd command. System groups are used for system purposes, which practically means that GID is allocated from 1 to 499 within the reserved range of 999. For more information on groupadd, see the groupadd(8) man pages. Readhat Basic Operation Guide Page 33 of 43

Attaching Users to Groups If you want to add an existing user to the named group, you can make use of the gpasswd command. Readhat Basic Operation Guide Page 34 of 43

Updating Group Authentication The gpasswd command administers /etc/group and /etc/gshadow files. Note that this command works only if run by a group administrator. Who is a group administrator? A group administrator can add and delete users as well as set, change, or remove the group password. A group can have more than one group administrator. The root user can add group administrators with the gpasswd -A users groupname where users is a comma-separated list of existing users you want to be group administrators (without any spaces between commas). For changing a group's password, run the gpasswd command with the relevant group name. You will be prompted to type the new password of the group. Example Changing a Group Password The password for the group crowd has been changed. You can also remove the password from the named group by using the -r option. Readhat Basic Operation Guide Page 35 of 43

Modifying Group Settings When a group already exists and you need to specify any of the options now, use the groupmod command. The logic of using groupmod is identical to groupadd as well as its syntax: To change the group ID of a given group, use the groupmod command in the following way: To change the name of the group, run the following on the command line. The name of the group will be changed from GROUP_NAME to NEW_GROUP_NAME name. Example Changing a Group's Name The following command changes the name of the group schoolmates to crowd: Deleting Groups The groupdel command modifies the system account files, deleting all entries that refer to the group. The named group must exist when you execute this command. Readhat Basic Operation Guide Page 36 of 43

Additional Commands Refer to the following resources for more information about managing users and groups. Installed Documentation For information about various utilities for managing users and groups, refer to the following manual pages: chage(1) A command to modify password aging policies and account expiration. gpasswd(1) A command to administer the /etc/group file. groupadd(8) A command to add groups. grpck(8) A command to verify the /etc/group file. groupdel(8) A command to remove groups. groupmod(8) A command to modify group membership. pwck(8) A command to verify the /etc/passwd and /etc/shadow files. pwconv(8) A tool to convert standard passwords to shadow passwords. pwunconv(8) A tool to convert shadow passwords to standard passwords. useradd(8) A command to add users. userdel(8) A command to remove users. usermod(8) A command to modify users. For information about related configuration files, see: group(5) The file containing group information for the system. passwd(5) The file containing user information for the system. shadow(5) The file containing passwords and account expiration information for the system. login.defs(5) - The file containing shadow password suite configuration. useradd(8) - For /etc/default/useradd, section Changing the default values in manual page. Readhat Basic Operation Guide Page 37 of 43

Using RPM RPM has five basic modes of operation (not counting package building): installing, uninstalling, upgrading, querying, and verifying. This section contains an overview of each mode. For complete details and options try rpm --help, or turn to Section 16.5 Additional Resources for more information on RPM. Finding RPM Packages Before using an RPM, you must know where to find them. An Internet search returns many RPM repositories, but if you are looking for RPM packages built by Red Hat, they can be found at the following locations: The Red Hat Enterprise Linux CD-ROMs The Red Hat Errata Page available at http://www.redhat.com/apps/support/errata/ A Red Hat FTP Mirror Site available at http://www.redhat.com/download/mirror.html Red Hat Network Refer to Chapter 18 Red Hat Network for more details on Red Hat Network Installing RPM Packages RPM packages typically have file names like foo-1.0-1.i386.rpm. The file name includes the package name (foo), version (1.0), release (1), and architecture (i386). Installing a package is as simple as logging in as root and typing the following command at a shell prompt: rpm -Uvh foo-1.0-1.i386.rpm If installation is successful, the following output is displayed: Preparing... ########################################### [100%] 1:foo ########################################### [100%] As you can see, RPM prints out the name of the package and then prints a succession of hash marks as the package is installed as a progress meter. Starting with version 4.1 of RPM, the signature of a package is checked automatically when installing or upgrading a package. If verifying the signature fails, an error message such as the following is displayed: error: V3 DSA signature: BAD, key ID 0352860f If it is a new, header-only, signature, an error message such as the following is displayed: error: Header V3 DSA signature: BAD, key ID 0352860f If you do not have the appropriate key installed to verify the signature, the message contains the word NOKEY such as: Readhat Basic Operation Guide Page 38 of 43

warning: V3 DSA signature: NOKEY, key ID 0352860f Refer to Section 16.3 Checking a Package's Signature for more information on checking a package's signature. Note If you are installing a kernel package, you should use rpm -ivh instead. Refer to Chapter 39 Upgrading the Kernel for details. Installing packages is designed to be simple, but you may sometimes see errors. Un-installing RPM Packages Uninstalling a package is just as simple as installing one. Type the following command at a shell prompt: rpm -e foo Note Notice that we used the package name foo, not the name of the original package file foo-1.0-1.i386.rpm. To uninstall a package, replace foo with the actual package name of the original package. You can encounter a dependency error when uninstalling a package if another installed package depends on the one you are trying to remove. For example: Preparing... ########################################### [100%] error: removing these packages would break dependencies: foo is needed by bar-2.0.20-3.i386.rpm To cause RPM to ignore this error and uninstall the package anyway (which is also a bad idea since the package that depends on it will probably fail to work properly), use the --nodeps option. Upgrading RPM Packages Upgrading a package is similar to installing one. Type the following command at a shell prompt: Readhat Basic Operation Guide Page 39 of 43

rpm -Uvh foo-2.0-1.i386.rpm What you do not see above is that RPM automatically uninstalled any old versions of the foo package. In fact, you may want to always use -U to install packages, since it works even when there are no previous versions of the package installed. Since RPM performs intelligent upgrading of packages with configuration files, you may see a message like the following: saving /etc/foo.conf as /etc/foo.conf.rpmsave This message means that your changes to the configuration file may not be "forward compatible" with the new configuration file in the package, so RPM saved your original file, and installed a new one. You should investigate the differences between the two configuration files and resolve them as soon as possible, to ensure that your system continues to function properly. Upgrading is really a combination of uninstalling and installing, so during an RPM upgrade you can encounter uninstalling and installing errors, plus one more. If RPM thinks you are trying to upgrade to a package with an older version number, the output is similar to the following: package foo-2.0-1 (which is newer than foo-1.0-1) is already installed To cause RPM to "upgrade" anyway, use the --oldpackage option: rpm -Uvh --oldpackage foo-1.0-1.i386.rpm Freshening RPM Packages Freshening a package is similar to upgrading one. Type the following command at a shell prompt: rpm -Fvh foo-1.2-1.i386.rpm RPM's freshen option checks the versions of the packages specified on the command line against the versions of packages that have already been installed on your system. When a newer version of an already-installed package is processed by RPM's freshen option, it is upgraded to the newer version. However, RPM's freshen option does not install a package if no previously-installed package of the same name exists. This differs from RPM's upgrade option, as an upgrade does install packages, whether or not an older version of the package was already installed. RPM's freshen option works for single packages or a group of packages. If you have just downloaded a large number of different packages, and you only want to upgrade those packages that are already installed on your system, freshening does the job. If you use freshening, you do not have to delete any unwanted packages from the group that you downloaded before using RPM. In this case, issue the following command: Readhat Basic Operation Guide Page 40 of 43

rpm -Fvh *.rpm RPM automatically upgrades only those packages that are already installed. Querying RPM Packages Use the rpm -q command to query the database of installed packages. The rpm -q foo command displays the package name, version, and release number of the installed package foo: foo-2.0-1 Note Notice that we used the package name foo. To query a package, you need to replace foo with the actual package name. Instead of specifying the package name, you can use the following options with -q to specify the package(s) you want to query. These are called Package Specification Options. -a queries all currently installed packages. -f <file> queries the package which owns <file>. When specifying a file, you must specify the full path of the file (for example, /usr/bin/ls). -p <packagefile> queries the package <packagefile>. There are a number of ways to specify what information to display about queried packages. The following options are used to select the type of information for which you are searching. These are called Information Selection Options. -i displays package information including name, description, release, size, build date, install date, vendor, and other miscellaneous information. -l displays the list of files that the package contains. -s displays the state of all the files in the package. -d displays a list of files marked as documentation (man pages, info pages, READMEs, etc.). -c displays a list of files marked as configuration files. These are the files you change after installation to adapt the package to your system (for example, sendmail.cf, passwd,inittab, etc.). For the options that display lists of files, you can add -v to the command to display the lists in a familiar ls -l format. Readhat Basic Operation Guide Page 41 of 43

Verifying RPM Packages Verifying a package compares information about files installed from a package with the same information from the original package. Among other things, verifying compares the size, MD5 sum, permissions, type, owner, and group of each file. The command rpm -V verifies a package. You can use any of the Package Selection Options listed for querying to specify the packages you wish to verify. A simple use of verifying isrpm -V foo, which verifies that all the files in the foo package are as they were when they were originally installed. For example: To verify a package containing a particular file: rpm -Vf /bin/vi To verify ALL installed packages: rpm -Va To verify an installed package against an RPM package file: rpm -Vp foo-1.0-1.i386.rpm This command can be useful if you suspect that your RPM databases are corrupt. If everything verified properly, there is no output. If there are any discrepancies they are displayed. The format of the output is a string of eight characters (a c denotes a configuration file) and then the file name. Each of the eight characters denotes the result of a comparison of one attribute of the file to the value of that attribute recorded in the RPM database. A single. (a period) means the test passed. The following characters denote failure of certain tests: 5 MD5 checksum S file size L symbolic link T file modification time D device U user G group M mode (includes permissions and file type)? unreadable file Readhat Basic Operation Guide Page 42 of 43