280 likes | 389 Views
System Administration Software Management & User Management. 1. Contents. Managing Software Managing Users Some Useful notes Security modules. 2. Managing Software. RPM YUM Non-RPM packages. 3. Managing Software. Red Hat Package Management ( RPM )
E N D
System Administration Software Management & User Management 1
Contents • Managing Software • Managing Users • Some Useful notes • Security modules 2
Managing Software • RPM • YUM • Non-RPM packages 3
Managing Software • Red Hat Package Management (RPM) • It was first used with Red Hat 2.0. • Improving the package management • Could ease the task of building software for different platform from a single set of source-code files. 4
rpm Command • It is used to install, remove, upgrade, verify and build software archives. • RPM uses the system’s /var/lib/rpm to store various files containing information about the software installed. • The primary database of installed software is contained in the file named Packages. 5
rpm Command Tasks • Installing new software. • Erasing or removing outdated or unneeded packages. • Upgrading an installed software package. • Querying to get information about a software package. • Verifying the installation or integrity of a package installation. 6
Related Tags • -i install • -e erase • Check dependencies while removing a package • rpm -e samba • error: Failed dependencies: samba is needed by (installed) system-config-samba-1.2.83-1.fc12.noarch • two choices • ignore the dependency by including the rpm --nodeps option • remove the dependent package first 7
Related Tags • -U upgrade • -q query • rpm -q • –ql list options to list the files in a package • rpm -ql logrotate • -qa display a list of all packages installed on the system • –qi displays information about a package • rpm -qi logrotate 8
Related Tags • -qf determine which package a file belongs to. • rpm -qf /bin/more • -V verify • -vh provide a more verbose output and display of hash mark • -lpq where the package is installed • rpm -qf /bin/more util-linux-ng-2.16-10.2.fc12.i686 9
Installing software from source • The installation procedure for software that comes in tar.gz and tar.bz2 packages isn't always the same, but usually it's like this: • Step 1. Unpacking • # tar xvzf package.tar.gz (or tar xvjf package.tar.bz2) 10
Installing software from source • Step 2. Configuring • it's done by running the configure script. • $cd pkg • $./configure • configure just checks your system and assigns values for system-dependent variables. These values are used for generating a Makefile. The Makefile in turn is used for generating the actual binary. 11
Installing software from source • Step 3. Building • build the binary, the executable program, from the source code. • $ make • Step 4. Installing • $ su • # make install 12
Installing software from source • Cleaning up the mess • $ make clean • Uninstalling • #make uninstall 13
Contents • Managing Software • Managing Users • Some Useful notes • Security modules 14
Managing Users • Each system has two kinds of users: • Superuser (root) • Regular user • Each user has his own username, password, and permissions that can only be assigned by the user. • All users have a user ID (UID) and a group ID (GID). 15
The su Command • It is necessary for regular users to run a command as if they were root. • The su means substitute user. • This command changes the UID and GID of the existing user. • The syntax for the su command is this: su option username arguments • To return to the regular users’ identity • exit 16
The su Command • Use su with the –c option to run a single command with root privileges • su -c "kill -15 4982" • su -c “ls /root” • su -c “ls /home/bob” – bob read bob's home directory. 17
The sudo Command • It gives to the certain users only a few superuser permissions. • The list of authorized users is kept in /etc/sudoers • Sudo will prompt for a password and then check the /etc/sudoers. 18
Groups • /etc/group • The custom is to use GIDs of 500 or more for regular users and less for administrations or special program. • Groupname:password:gid:users root:x:0:root bin:x:1:root,bin,daemon test:x:500: • Special group • Allow these services to manage their own files with permissions that restrict other users from them. 20
The Password File • /etc/passwd • It is the database file for all users on the system. • Username:password:uid:gid:comment:homedir:shell 21
Shadow Passwords • /etc/shadow • It is considered to use the encrypted passwords found in /etc/passwd. • Only x or * appears in the passwprd field of /etc/passwd. • * in password means disable. 22
Shadow Password Fields • User name : It is your login name • Password: It your encrypted password. • Last password change (lastchanged): Days since Jan 1, 1970 that password was last changed • Minimum: The minimum number of days required between password changes. • Maximum: The maximum number of days the password is valid (after that user is forced to change his/her password) 23
Shadow Password Fields • Warn : The number of days before password is to expire that user is warned • Inactive : The number of days after password expires that account is disabled • Expire : days since Jan 1, 1970 that account is disabled i.e. an absolute date specifying when the login may no longer be used 24
User’s Home Directory • When each user is created, a home directory is created for him (/home/<username>). • The set of files that initially are used to populated this home directory are kept in /etc/skel. 25
User Management Commands • useradd • userdel • Delete a user • userdel -r username • usermod • groupadd • groupdel • groupmod • grpck • Verify the integrity of the system authentication information. 26
Useradd • Useradd creates a new user • Based on the /etc/login.defs file, the system creates a home directory for the new user. • copies the contents of /etc/skel in the users home • useradd [-c comment] [-d home_dir] [-e expire_date] [-f inactive_time] [-g initial_group] [-G group[,...]] [-m [-k skeleton_dir]] [-p passwd] [-s shell] [-u uid [ -o]] login • useradd -g 500 -c "Alex Watson" alex –p 4567654 • The –D option displays default options • Use passwd to give the user a password. 27
Communicating With Users • write • Send a message to a user • wall (write all) • Sends a message to the terminals of all user connected to the system. 28
Some Useful Command • chmod Change file access permission chown Change file owner or group chroot Run command with special root directory crond Daemon to execute scheduled program