You are on page 1of 256

INTRODUCTION TO UNIX

Solaris System Administration

Primarly influenced by Multics First version of UNIX developed by Ken Thompson in 1969 on DEC PDP for business, scientific and industrial users Originally written in Assembly language for PDP-7 Transportability facilitated by Thompson in B Language B modified by Richie as C Language Thompson and others wrote Unix in C in 1980 to be able to port on any computer

Solaris System Administration

FEATURES OF UNIX
Multitasking Multiuser On line help Communication and Electronic mail

Solaris System Administration

FEATURES OF UNIX CONTINUES...


Available on micros, minis and mainframes Hierarchical file system Library of application software

Solaris System Administration

SYSTEM CONCEPTS

Solaris System Administration

UNIX
KERNEL

SHELL

Kernel Shell

APPLICATION SOFTWARE

Applications

Solaris System Administration

KERNEL is the heart of the UNIX operating system. It is next to the hardware. It is responsible for scheluing tasks and managing data storage SHELL is the command interpreter. It is an interfacce between the user and the kernel. APPLICATION SOFTWARE are the specific capabilities added on to the operating system

Solaris System Administration

SHELLS BOURNE prompt - ($) -> DEFAULT SHELL C prompt - (%) -> HAS SYNTAX SIMILAR TO C LANGUAGE KORN prompt - ($) -> BOURNE + ALIASING, HISTORY, ETC.

Solaris System Administration

FILE SYSTEM STRUCTURE


(Hierarchical Inverted-Tree Structure)

/ (ROOT)

USR

OPT

DEV

ETC

EXPORT

KERNEL

VAR

lib

sbin

bin

dsk

tty

home

genunix

ssa1

ssa2

Solaris System Administration

COMMON TERMS USED

HOST
HOST NAME IP ADDRESS SERVER CLIENT

NETWORK
DAEMON MULTITASKING MULTIUSER DISTIBUTED PROCESSING
10

Solaris System Administration

SYSTEM RUN LEVELS


Objectives :
Change Run Levels

Shutdown & Booting Commands Reboot


Solaris System Administration 11

Changing Run Levels

Init Command e.g. init 6 will reboot the System to default run level
Solaris System Administration 12

Boot Command

boot <devicename> -[options] devicenames cdrom


disk net Options -a for interactive boot -r to reconfigure system -s for booting to single user
Solaris System Administration 13

Shutdown Command

shutdown [-y] [-g seconds] (-init state)[message]


yes Grace period(60 sec) Init levels (0,1,5,6) e.g. shutdown -y -g 0 -I 0 warning

will immediately shutdown the system to level 0

Solaris System Administration

14

Other Boot/Reboot Commands

halt

poweroff
reboot

Not Recommended

Solaris System Administration

15

OPEN BOOT PROM(OBP)

Solaris System Administration

16

OPEN BOOT PROM

Resident firmware that provides basic hardware testing & initialization prior to booting. It is used for testing & initializing system hardware determines the configuration boots the operating system provides interactive debugging facilities
Solaris System Administration 17

SYSTEM BOARD

Sbus

BOOT PROM

Custom Driver
ID - PROM

Third Party Sbus Card


Solaris System Administration 18

BOOT PROM VERSIONS

1.x
(ORIGINAL SPARC BOOT PROM)

2.x
(FIRST OPEN BOOT PROM)

3.x
(OBP WITH DOWNLOADABLE FIRMWARE)

Solaris System Administration

19

BASIC OBP COMMANDS

banner boot help printenv setenv set-defaults

devalias probe scsi probe - scsi - all probe - ide reset

Solaris System Administration

20

CHANGING DEFAULT BOOT - DEVICE

ok

setenv boot - device = NET

ok

reset

ok

boot
Solaris System Administration 21

CREATING CUSTOM DEVICE ALIASES

nvalias

nvunalias

Solaris System Administration

22

EEPROM COMMAND

Lists eeprom settings

Changes need not be followed by reset

Solaris System Administration

23

STOP KEY
stop - a key sequence
puts system into obp command mode. Use sync to synchronize file systems.

stop - n
starts/boots the system with default values.

Solaris System Administration

24

SOLARIS INSTALLATION

Solaris System Administration

25

SOFTWARE GROUPINGS
CONFIGURATION CLUSTERS SOFTWARE CLUSTERS PACKAGE CDE Demos CDE CDE developer s/w CDE DT BUILDER

CDE Man pages


Solaris System Administration 26

O P T I O N S

ENTIRE DISTRIBUTION ENTIRE DEVELOPER END USER

CORE

DISTRIBUTION
Solaris System Administration

PLUS OEM DRIVERS


27

HARDWARE REQUIREMENTS FOR SOLARIS 7 INSTALLATION


SPARC / INTEL SYSTEM
1.05 GB HDD SPACE 64 MB RAM CD-ROM DRIVE or INSTALL SERVER
Solaris System Administration 28

SYSTEM INFORMATION
HOST NAME

IP ADDRESS
NAME SERVICE

SUBNET
GEOGRAPHIC LOCATION TIME ZONE INFORMATION ROOT PASSWORD
Solaris System Administration 29

INSTALLATION TYPES

UPGRADE
Initial Precautions
Notify Users Backup Files Shutdown System

INITIAL

(Fresh Installation)

Solaris System Administration

30

LOG OF INSTALLATION

/var/sadm/install_ data/install_log

Solaris System Administration

31

SOLARIS BOOT PROCESS

Solaris System Administration

32

BOOT PROCESS
PROM executes POST

BOOTS PROM Phase

Determines Boot device (eg. Disk,net,CD-ROM) Reads Boot Block ( Sector 1- 15) PROM loads Bootblk Program Bootblk loads (ufsboot) program

BOOT Program phase


Kernel Initialization phase

ufsboot loads 32-bit/64-bit kernel


Loads kernel Modes Reads \etc\system file Kernel initialized and starts init process

/sbin/init phase

Init process starts and run control scripts


Solaris System Administration 33

KERNEL

consists of a two piece static core (unix & genunix) and loadable modules.

LOADABLE MODULES

is a device driver which is loaded when device is accessed.


Solaris System Administration 34

KERNEL STRUCTURE
Resides in /platform/uname-m/kernel/unix
KERNEL misc drv

fs
exec genunix Sys

Sched
Strmod
Solaris System Administration 35

/etc/system file
Can be customized to change kernel configuration process

moddir - modifies search path for kernel modules. rootdev - determines alternate root device. exclude - modules to be excluded even if referenced. forceload - modules loaded forcibly at boot time.

Overrides default value using

variable = value

eg. set -pt-cnt =100 set npty = 100 - sets pseudo-ttys to 100.
Take backup before editing .
Solaris System Administration 36

SYSTEM RUN LEVELS & INITIALIZATION FILES

Solaris System Administration

37

SYSTEM RUN LEVELS


0 1

PROM monitor Run level Single user mode

Used for performing Administrative tasks.

Multi-user mode (no resources shared).

3
4 5

Multi-user mode (resources shared).


Not used. Halt.

Reboot.
Single user mode with user logins disabled.
Solaris System Administration 38

S,s

/etc/inittab
S3 : 3 : wait : |sbin|rc3 >/dev/console 2 < > |dev|console
id rstate action

Command to execute

Solaris System Administration

39

init process and /etc/inittab


/etc/inittab
init process
Set initdefault to level 3.

Run entries with sysinit in Action field. Run entries with 3 in rstate field.

Solaris System Administration

40

/etc/rc#.d

Contains scripts to start /stop

daemons/services.
Scripts starting with alphabet k. Scripts starting with alphabet s starts

process/services eg. S71 inetinit


Solaris System Administration 41

/etc/init.d

Contain run control scripts HARD

LINKED to start/ kill scripts in


eg. Sendmail nfs.server etc Services can be started/stopped in running system eg. /etc/init.d/nfs.server

/etc/rc#.d

start

Solaris System Administration

42

DISK CONFIGURATION & PARTITIONING

Solaris System Administration

43

LOGICAL DISK DEVICE NAMES


/dev /[r] dsk /c n tn dn sn

The /dev directory The rdsk or dsk subdirectory Controller number Target number

Disk number
Slice number
Solaris System Administration 44

VTOC - Volume Table Of Contents


Slice 2 Slice 0 Slice 1 VTOC (sector 0)

Disk Geometry - Describes the no. of heads , sectors and cylinders. Partition Tables - Describes the slices on the disk.

Volume Names - Identifies the disk device (optionally assigned by the system administrator.) Slice Tags - name the standard mount points for each of the slices. Slice Flags - Label whether each slice is writeable and mountable.
Solaris System Administration 45

Displaying a Disks VTOC


# prtvtoc /dev/rdsk/c0t0d0s0
* /dev/rdsk/c0t0d0s0 partition map ** Dimensions * 5 12 bytes/sector * 80 sectors/track * 9 tracks/cylijnder * 720 sectors/cylinder * 2500 cylinders * 1151 accessible cylinders * * Flags : * 1: unmountable * 10: readonly * * First Sector Last * Partition Tag Flags Sector Count Sector * 0 2 00 0 41040 41039 * 1 3 01 41040 205200 246239 * 2 5 00 0 828720 828719 * 5 6 00 246240 20880 267119 * 6 4 00 267120 561560 828719
Solaris System Administration

Mount Directory / /opt /usr


46

PARTITIONING DISK
partition> 0 Part 0 Tag root Flag wm Cylinders 0 - 41 Size Blocks 14.77mb(42/0/0)

Enter Partition id tag[root] : <cr> Enter Partition Permission Flags[wm] : <cr> Enter new starting cylinder[0] : <cr> Enter Partition size[30132b, 42c, 14.77mb] : 16mb
Disk Blocks Cylinders Mbytes
Solaris System Administration 47

What Makes a Partition Into a File System


CPU Memory

Super Block Super Block Updated Every 30 seconds

Loaded into memory at boot time Boot Blocks (15 sectors)

Slice 6 Super Blocks (16 sectors)


Solaris System Administration

Slice 1 Slice 0

Disk label (1 sector)


48

Creating a New File System


# newfs /dev/rdsk /c0t1d0s0

newfs : construct a new file system /dev/rdsk/c0t1d0s0: (y.n) ? Y


/dev/rdsk/c0t1s0d0 : 28188 sectors in 87 cylinders of 9 tracks, 36

sectors
15.5MB in 3 cyl groups (16 c/g, 5.90MB/g, 2688 i/g ) super-blocks backups (for fsck -F ufs -o b= #) at : 32, 11632, 23232,
Solaris System Administration 49

BACKGROUND STRUCTURES
VTOC Boot block
Super block Backup Superblock Cylinder group block Inode table

Data block(s)

Created by the newfs command

Backup super block Cylinder group block Inode table

Data block(s)
Backup Superblock Cylinder group block Inode table
Solaris System Administration 50

Super Block & Cylinder Group Block


Super Block Super Block clean flag. Number of cylinder groups Number of data blocks. Number of fragments in data block. Size of data block. Size of a fragment. Number of tracks in a cylinder. Number of sectors in a track. Number of sectors per cylinder. Number of cylinders in the partition.
Cylinder Group Block Number of cylinders. Number of data blocks. Position of the last used data block. Number of free data blocks and their locations. Position of the last used fragment. Number of free fragments.
Solaris System Administration 51

File inodes
inode Data blocks Permissions Links and other Information Indirect blocks

0 1 2 3 4 5 6 7 8 9 10 11 12

2048 data blocks

Double indirect block 2048 addresses

2048 data blocks Indirect block 2048 addresses


Solaris System Administration 52

13

FILE SYSTEMS STRUCTURE

Solaris System Administration

53

FILE SYSTEM
Collection of files & directories used to store & organize information Collection of control structures & data blocks of a partition File Systems

ufs

hsfs
Disk -based

pcfs

NFS

psuedo

Network based Cachefs etc.


Solaris System Administration 54

Label

1-15
16-31 32

Boot Block
Superblock

Backup superblock
First Cylinder Group 47 Cylinder group block

Inode table
Data Blocks Second Cylinder group
Solaris System Administration 55

CYLINDER GROUPS

Cylinder Group Blocks


Inode tables Data blocks

Solaris System Administration

56

Inodes

Direct Pointers
Indirect Pointers

single indirect double indirect triple indirect


Solaris System Administration 57

The fsck utility

The fsck program is run when a system


boots

The fsck program runs in two modes :

Non-Interactive mode interactive mode


Solaris System Administration 58

checked by the fsck utility

Superblock summary information


cylinder group block

inode information
file system data block information

directory information
Solaris System Administration 59

fsck Output
The following is the fsck program when no inconsistencies were discovered: # fsck /dev/rdsk/c0t3d0s7 **last mounted on /export/home **Phase 1 - check blocks and sizes **Phase2 - check pathnames **Phase3 - check connectivity **Phase4 - check Reference counts **Phase5 - check Cyl groups 2 files,9 used, 21606 free

Solaris System Administration

60

MONITORING FILE SYSTEM


df df-k
capacity/usage of file system

du
display disk usage

quota
disk usage by a user

du -a /usr (in blocks)

quot [-af] filesystem all filesystems and no. of files

Solaris System Administration

61

MOUNTING FILESYSTEM

format command
creates a slice out of a disk.

newfs command
creates a file system out of a

raw slice.
Solaris System Administration 62

ALTERNATIVE SUPERBLOCKS

If superblock is corrupted, run fsck to use a


backup superblock

Locate the backup superblock at offset 32 of


file system

Use newfs -N to locate backup superblocks


Solaris System Administration 63

MOUNTING FILES

The process by which separate file systems


are attached to the file-system hierarchy

(file tree structure)


/etc/vfstab Manual mounting(from the command line)


Solaris System Administration 64

EXAMPLE MOUNT COMMANDS

to mount a file system manually # mount /dev/dsk/c0t3d0s7 /export/home to enable UFS logging # mount -o logging /dev/dsk/c0t3s6 /usr to mount a file system with largefiles disabled #mount -o nolargefiles /dev/dsk/c0t3d0s7 /export/home to mount a file system using the content of the /etc/vfstab file #mount /export/home
Solaris System Administration 65

/etc/vfstab file
The /etc/vfstab virtual file system table provides default entries for mounting file system at boot time. The format of the file is one record per line,seven fields per record with a dash(-) indicating a null value for a field. #device device mount fs fsck mount mount #to mount to fsck point type pass at boot ops

#dev/dsk/c1d0s2 /proc fd

/dev/rdsk/c1d0s2 -

/usr /proc

ufs proc

1 -

yes no no -

/dev/fd fd

swap

/tmp
/ /usr /export /opt -

tmpfs
ufs ufs ufs ufs -

1 1 5 8 swap

yes
no no yes

logging logging

/dev/dsk/c0t3d0s0 /dev/rdsk/c0t3d0s0 /dev/dsk/c0t3dos6 /dev/rdsk/c0t3d0s6 /dev/dsk/c0t3d0s3 /dev/rdsk/c0t3d0s3

/dev/dsk/c0t3d0s7
/dev/dsk/c0t3d0s5 /dev/dsk/c0t3d0s1 -

/dev/rdsk/c0t3d0s7
/dev/rdsk/c0t3d0s5 -

/export/home ufs 5

yes
yes -

logging
logging no
66

Solaris System Administration

mountall commands

mountall -l
Mounts all local filesystems

mountall -r
Mounts all remote filesystems

Solaris System Administration

67

umountall commands

umountall -l
Unmounts all local filesystems

umountall -r Unmounts all remote filesystems

Solaris System Administration

68

MOUNTING DIFFERENT TYPES OF FILESYSTEMS

Create a mount point


#mkdir /pcfs

specify the file system tape # mount -F pcfs /dev/diskette /pcfs

#mount -F hsfs -o ro /dev/dsk/c0t6d0s0/cdrom


Solaris System Administration 69

HOW FILE SYSTEM TYPE IS DETERMINED

/etc/vfstab file

/etc/default/fs and /etc/dfs/fstypes files

Solaris System Administration

70

NFS CLIENT ACCESS


Using the dfshares and mount commands

determine NFS file system availability from a server #dfshares sun mount a remote resource # mount -f nfs -o ro sun:/usr/share/man /usr/share/man unmount a remote resource # umount /usr/share/man

Solaris System Administration

71

BASIC UTILITIES (EDITORS)

Solaris System Administration

72

ed (Line Editor)

vi (Visual Editor)

Solaris System Administration

73

PACKAGE ADMINISTRATION

Solaris System Administration

74

Objectives
Information of Installed Packages
Adding New Packages

Deleting Packages
Checking Consistencies

Spooling Packages
Solaris System Administration 75

PACKAGE CONTENTS

Description Of Package
Description Of Relationships To Target System
e.g. Disk space required

Files To Be Installed Pre & Post Installation Scripts


Solaris System Administration 76

PACKAGE ADMINISTRATION
COMMANDS
pkginfo

ADMINTOOL

pkgrm
pkgchk pkgadd

Solaris System Administration

77

PKGINFO
Display Software Package Information Command Format pkginfo [-d [device | pathname]]
Device where S/W resides

[-l]

pkg_name
Name Of Package

Displays Detailed Information

Solaris System Administration

78

EXAMPLE
a) pkginfo | more
Application SUNWAxg System
Category

Solaris XGL 3.3 AnswerBook


Solaris Documentation Server
Name of Package

SUNWab 2u
System Name

b) Checking S/W packages on CD


pkginfo -d /cdrom/cdrom0/s0/solaris_2.7/product |more
Solaris System Administration 79

pkgrm
pkgrm <package_name>
warns about possible package dependencies a shared file is removed only when last of sharing package is removed
Solaris System Administration 80

pkgadd
Adds packages Spooling Packages

pkgadd -d <device path name> package name

Stages in Package addition


Checks Package & System Information Verifies Package Requirements Verifies Disk Space Requirements Checks For Package Conflicts Starts the Installation
Solaris System Administration 81

PACKAGE SPOOLING

Copying Package Without Installing it Package -d <device name> -s spool <package name> Default Spool Directory is /var/spool/pkg

e.g. pkgadd -d /cdrom/cdrom0/s0/solaris_2.7/product -s spool SUNWaudio OR pkgadd -d /cdrom/cdrom0/s0/solaris_2.7/product -s /export/spool_dir SUNWaudio


Solaris System Administration 82

PKGCHK
Compares various attributes & contents of package

pkgchk [ -p [path1] [path2] ]

<package name>

e.g. pkgchk SUNWaudio

Solaris System Administration

83

Important Files/Directories
/opt/pkgname - Preferred location for unbundled Packages /opt/pkgname/bin OR Preferred location for /opt/bin executables /var/opt/pkgname OR log files of packages /etc/opt/pkgname /var/sadm/install/contents - package map of entire system

Solaris System Administration 84

PATCH ADMINISTRATION

Solaris System Administration

85

OBJECTIVES
Obtain Patch Information

Verify Current Patches Installed Install Patches Remove Patches

Solaris System Administration

86

PATCH NUMBERING
1011945-34

PATCH DISTRIBUTION

(revision number)

WWW

FTP Server

CDROM for SunService Customer

www.sunsolve.com www.sun.com metalab.unc.edu


Solaris System Administration

87

PATCH FORMATS

zip Files (.z)


# Extracted using
zcat path.z | tar xvf

compressed tar
# Extracted using
tar xvf <patchfile>

gzip files
# Extracted using
gzip utility (www.gzip.org)

Solaris System Administration

88

IMPORTANT
Never modify/edit contents of files in /var/sadm/patch /var/sadm/patch has historical information of patches installed on system.

Solaris System Administration

89

PATCH VERIFICATION
showrev -p or patchadd -p

displays complete patch information like


incompatibles , packages etc.

PATCH REMOVAL
patchrm <patchnumber>
Solaris System Administration 90

USER ADMINISTRATION

Solaris System Administration

91

OBJECTIVES

Use admintool to create new groups & users


setup password aging/locking useradd/usermod/userdel commands

Solaris System Administration

92

ADMINTOOL

GUI utility to maintain system databases for

users groups hosts printers serial ports software


Solaris System Administration 93

useradd command

Creates new user account new login remains locked until password command is used Options:
-comment -d <dir> -e -f -g -u -s -o e.g -c trainee e.g -d /home/trainee e.g -e 10/6/99 e.g -f 10 e.g -g other e.g -u 100 e.g -s /bin/sh allows duplication of uid
Solaris System Administration 94

usermod command
Modifies a existing user account e.g

usermod -g other -d /export/home/trainee -m -l guest trainee

group

New loginname New directory moves users directory to new location

Solaris System Administration

95

userdel command

Deletes user account userdel [-r] login


removes users home directory

Solaris System Administration

96

System initialization files for users

Initialization files

contains a series of commands that are executed when a shell is started Customize the environment for that shell
System (Read first) /etc/profile User (Read second/third) $HOME/.profile Template /etc/ skel Local.profile

Shell

Bourne

Korn

/etc/profile

/etc/profile

$HOME/.profile then $HOME/.login $HOME/ .cshrc then $HOME/.login


Solaris System Administration

Local.profile

Local.profile
97

.dtprofile File

is used by CDE users resides in users home directory is created the first time a user logs in

Solaris System Administration

98

/etc/profile Script

exports environment variables


exports PATH sets TERM displays /etc/motd sets default permissions checks for mail
Solaris System Administration 99

/etc/skel directory
skel

Local .cshrc

Local .profile
.profile

Local .login

Solaris System Administration

100

Rereading the initializing files


Bourne and korn shells $ cd $ . ./.profile $ . ./.kshrc C shell % source ~/.login % source ~/.cshrc

Solaris System Administration 101

SYSTEM SECURITY

Solaris System Administration

102

OBJECTIVES

Security Overview of files


Superuser Account

Effective user ids & group ids


Administrating File Ownerships Monitoring System Access
Solaris System Administration 103

SECURITY IN SOLARIS

Password authentication

File access permissions

ACLs
Solaris System Administration 104

SECURITY FILES

/etc/password

/etc/shadow

Solaris System Administration

105

/etc/password

Contains entry for each system user Contains the following information: login ID username x placeholder for password UID number used by system to recognize the user GID number representing users primary group comment home directory

login shell
Solaris System Administration 106

/etc/shadow

Contains encrypted password


login ID

password(Encrypted form)
lastchg - no. of days between last password change and 1 Jan 1970

min- minimum no of days between password change


max warn

inactive
expire
Solaris System Administration 107

/etc/group

Defines all system groups a user belongs to fields :


groupname password GID userlist

Solaris System Administration

108

SUPERUSER ACCOUNT

Performs administrative tasks

shutting down system backing up & restoring file systems mounting & unmounting file resources user management etc.

password aging should be enabled password should be changed frequently

Solaris System Administration 109

id command
Identifies user id -a

displays uid ; name ; gids of groups.

Solaris System Administration

110

su command

Used to change to other users A/C su - <username>

provides the environment of user

all su attempts are logged in /var/adm/sulog


Solaris System Administration 111

Administrating File Ownership


chown (changes file ownership) chgrp (changes group name of file)

e.g. e.g. chown user1<files> chgrp grp1 file1 or chown -R dir1 or chown -R user:grp1 dir1
Solaris System Administration 112

/etc/default directory
passwd
controls system-wide password aging variables: - MAXWEEKS
-MINWEEKS -PASSLENGTH

login
restricting super user access variables:
-PASSREQ -CONSOLE
Solaris System Administration

su
logging su attempts

113

Monitoring System Access

who
who -u

finger
displays detailed user a/c information

last
login & logout information

sulog
/var/adm/sulog

Solaris System Administration

114

PROCESS CONTROL

Solaris System Administration

115

OBJECTIVES

ps command
kill command & options

pgrep & pkill


at / crontab commands

structure of crontab file & process scheduling


Solaris System Administration 116

Process Status
ps Lists processes currently running on system

options
-e :- information of all processes -f :- full listing

-u :- processes of particular users

Solaris System Administration

117

The kill command


Command format kill [-signal] PID(s) Signals

44 signals SIGTERM,signal 15,is default signal sent

Process termination # kill 1400


Solaris System Administration 118

pgrep
displays process id of process matching pattern

pkill
kills the process matching pattern

Usage
pgrep [-options] pattern pkill [-options] pattern

Options
-u :- matching UID -f :- a regular expression -t :- matching the terminal -G :- matching GID number e.g pkill -U user1 mails
Solaris System Administration 119

Process Manager

Tools( CDE option)


find process

proctool

Solaris System Administration

120

at command
Executes a command or script at a specified time /etc/cron.d/at.deny:-identifies users who cannot use at command

USAGE:

at [-m] [-r job]


send mail to user on completion

time [date]

removes a previously scheduled jobs


Solaris System Administration 121

Running commands at specified time

Displaying the crontab file :


crontab -l

using root crontab file


/etc/cron.d/logchecker
/usr/lib/newsyslog

controlling crontab access


/etc/cron.d/cron.allow /etc/cron.d/cron.deny
Solaris System Administration 122

User access to CRON

By default the cron.deny file prohibits crontab use from the following system users:

daemon bin smtp nuucp listen nobody noaccess

The cron.allow file does not exist by default


Solaris System Administration 123

The crontab file format


The crontab file consists of entries with six fields in each entry. The fields are separated by spaces or tabs. 10 3 * * 0 /usr/lib/newsyslog The command field
The day of week field,values 0-6 .0 is sunday

The month field,values 1-12 The hour field,values between 0-23


The day of month field,values 1-31 The minute field,values between 0 and 59

Solaris System Administration

124

How to edit a users crontab file

Set the editor variable to specify the editor to use


Edit the crontab file using crontab -e View the current crontab file using crontab -l

Solaris System Administration

125

ADVANCED FILE PERMISSIONS

Solaris System Administration

126

FILE PERMISSIONS REVIEWED


The Octal Mode
Octal mode is based on the base eight numbering system(07 are the available numerals). Each permission has an octal value as follows:
Octal Values 4 Permissions Read

2
1

Write
Execute
Solaris System Administration 127

The octal values for the permissions set are :


Octal Value 7 6 5 4 3 2 1 0 Permissions rwx rwr -x r --wx -w- -x - --

Solaris System Administration

128

umask filter
Determine the default permissions for files and directories Assigns permissions during the creation of new files and directories Displays your umask $ umask 022 Enables users to set their own umask value

Solaris System Administration 129

Changing the umask value


In the current shell $ umask 027 $ umask 027 PERMANENTLY CHANGING umask $ vi .profile # @(#)local.profile 1.4 93/09/15 SMI # stty istrip Path=.:/usr/bin:/usr/usb:/etc export PATH umask 027

Solaris System Administration 130

ACCESS CONTROL LISTS(ACLS)

Provides greater control over file permissions


Provides traditional UNIX file protection and more

Solaris System Administration

131

setfacl command
Syntax
setfacl [options] acl_entry filename1 [filename2...] Options -m Creates or modifies an ACL -s Replaces the entire ACL with new ACL -d Deletes ACL entries -r Recalculates ACL permissions acl_entry Is an ACL entry filename Is a file or directory which contains the ACL entries
Solaris System Administration 132

EXAMPLES

Adding read/write permissions for ssa20


$ setfacl -m user:ssa20:6 ch3.doc

Checking if a file has an ACL


$ ls -l ch3.doc -rwxr-----+ 1 william sysadmin 163 Nov 11 11:12

Deleting an ACL entry


$ setfacl -d user:ssa20:6 ch3.doc
Solaris System Administration 133

getfacl command

Used to verify that an ACL was set on the file

SYNTAX getfacl [options] filename1 [filename2] OPTIONS


-a
-d displays the file name,owner,group, and ACL entries for the specified file or directory displays the file name,owner,group and default ACL entries for the specified directory
Solaris System Administration 134

setuid and setgid


These special permissions enable you to control the modification of files and create shared directories

executable programs directories setuid and setgid permissions

e.g.
$ ls -l /bin/passwd /etc/shadow -r-sr-sr-x 3 root sys 99640 sep 1 1998 /bin/passwd -r-------- 1 root sys 493 Apr 12 16:13 /etc/shadow
135

Solaris System Administration

Using setuid and setgid permissions


Setting setuid and getuid permissions

numeric or symbolic notation

controlling modification of files e.g. #chmod 4755 setuid_program #chmod 2755 setgid_program creating shared directories #chmod g+s some-directory
Solaris System Administration 136

The STICKY bit


Determining the characteristics of a directory with set sticky bit identifying sticky permission $ ls -ld /var/tmp drwxrwxrwxt 2 sys sys 512 may 26 11:02 /var/tmp setting the sticky permission # chmod 1777 project # ls -ld project drwxrwxrwxt 2 root other 512 nov 15 14:30 project #chmod a=rwxt project $ ls -ld project drwxrwxrwxt 2 root other 512 nov 15 4:30 project
Solaris System Administration 137

DEVICE ADMINISTRATION

Solaris System Administration

138

Logical device Name

Used by system administrator to reference devices These names are symbolically linked to their corresponding physical device name The logical names are located in the /dev directory and are created at the time when the physical names are created
Solaris System Administration 139

System board SCSI host adapter c0 fas0

t1

t6

t0
scsi ctlr

scsi ctlr

scsi ctlr

DEVICE NAMING CONVENTIONS s0

d0 s5

d1 s0 s6

d2

s6
/dev/dsk/c0t0d0s0

/dev/dsk/c0t0d0s0
/dev/dsk/c0t0d0s1

s1

/dev/dsk/c0t0d0s5 /dev/dsk/c0t0d0s6 /dev/dsk/c0t0d0s6


140

Solaris System Administration

/dev/[r]dsk/c# t# d# s#

Controller number

Target number
Logical unit number

Slice number

Solaris System Administration

141

PHYSICAL DEVICE NAMES


Devices PCI pci fdthree se dad psuedo

ide sd

Devices directory structure


Solaris System Administration 142

Device Instances

Kernels abbreviation for a device


dmesg displays instance names Instance disk is an abbreviation for the physical device name

e.g. /dev/sd0 represents an instance of a HDD.


Solaris System Administration 143

BSD NAMES

located in the /dev directory


used for backward compatibility

# ls -l /dev/sd0a lrwxrwxrwx 1 root root 12 oct 20 16:05 /dev/sd0a

dsk/c0t3d0s0

Solaris System Administration

144

dmesg command

Identifies the devices connected to the system


uses instance names and physical device names stores output in a buffer(get overwritten)

Solaris System Administration

145

The /etc/path_to_inst file


The following is from the /etc/path_to_inst file on an ultra 1 system using one SCSI controller :

/sbus@1f,0 0 sbus /sbus@1f,0/espdma@e,84000 0 dma /sbus@1f,0/espdma@e,84000/esp@e,88000 0 esp /sbus@1f,0/espdma@e,84000/esp@e,88000/sd@3,0 3 sd /sbus@1f,0/espdma@e,84000/esp@e,88000/sd@2,0 2 sd /sbus@1f,0/espdma@e,84000/esp@e,88000/sd@1,0 1 sd /sbus@1f,0/espdma@e,84000/esp@e,88000/st@3,0 3 st /sbus@1f,0/espdma@e,84000/esp@e,88000/st@5,0 5 st /sbus@1f,0/espdma@e,84000/esp@e,88000/st@4,0 4 st /sbus@1f,0/espdma@e,84000/esp@e,88000/st@1,0 1 st ses /sbus@1f,0/espdma@e,84000/esp@e,88000/ses@0,0 0 ses
Solaris System Administration 146

prtconf command
Displays systems configuration like memory & peripherals.

format command
Displays logical & physical device names.

Solaris System Administration

147

RECONFIGURING DEVICES
To add new devices
1. Create a /reconfigure file.

2. Set the SCSI target number.


3. Connect the new disk to the system. 4. Turn on the power. 5. Boot the system.
Solaris System Administration 148

SOLARIS NETWORKING

Solaris System Administration

149

IP ADDRESSING
Class A

Class B
large networks

Class C
Small/Mid size Network

very large networks

(upto 16 million)

(upto 65000)
128-191

(upto 254)
192-223

1-127

Solaris System Administration

150

NETWORKING FILES

/etc/inet/hosts or
/etc/nodename /etc/hostname.hme0

/etc/hosts

Solaris System Administration

151

/etc/inet/hosts

Stores ip addresses for host names


linked to /etc/hosts network entry 127 is reserved for local host network number network entry with keyword loghost identifies IP address of host
Solaris System Administration 152

/etc/hostname.hme0
identifies ethernet interface to be configured at boot up contains hostname or its ip address

/etc/nodename

contains system host name


Solaris System Administration 153

REMOTE ACCESS

Files

Commands
rsh
rlogin

/etc/hosts.equiv $home/.rhosts

rcp

Solaris System Administration

154

/etc/hosts.equiv

Identifies remote machines as trusted hosts does not exist by default

e.g. $ cat /etc/hosts.equiv


hostname1 userlist

hostname2 userlist
Solaris System Administration 155

$HOME/. rhosts

Does not exist by default

e.g $ cat $HOME/.rhosts hostname1 -> all users of hostname1 hostname2 -> user1 of hostname2
Solaris System Administration 156

rlogin

Logging in remotely

syntax :rlogin hostname [-l username]


Remote hostname
Solaris System Administration 157

rsh

Running commands remotely

syntax :rsh [-l username] hostname <command> e.g. rsh -l ssa1 venus ls - al

/var/mail
158

Solaris System Administration

rcp

Copying files across the network

rcp source-file hostname:destination file

Solaris System Administration

159

NETWORK FILE SYSTEM & MOUNTING

Solaris System Administration

160

THE NFS FILE SYSTEM

Some benefits of NFS file system are :

centralized files common software files appear to be local


Solaris System Administration 161

NFS TERMINOLOGY

NFS SERVER -- An NFS file server designates local file resources to be shared with other systems on the network
NFS Client -- An NFS client machine mounts file resources that are shared over a network and treats the file systems if they were local

Solaris System Administration

162

NFS server Daemons:


mountd,nfsd,statd and locked

NFS Client Daemons:


statd and lockd

Files:
/etc/dfs/dfstab /etc/dfs/sharetab /etc/rmtab

Files:
/etc/vfstab and /etc/mnttab

Commands:
share,unshare, shareall, unshareall, dfshares and dfmounts
Solaris System Administration

Commands:
mount,umount, mountall, umountall, dfshares and dfmounts
163

NFS DAEMONS

mountd daemon

mountd : responds to a client mount request with a file handle nfsd : processes subsequent client file operation requests statd and lockd - provide crash and recovery functions
Solaris System Administration 164

NFS server daemon

NFS daemons on the client and server

The /etc/dfstab file


The /etc/dfs/dfstab file is read when

the system enters run level 3 root executes the shareall command the /etc/init.d/nfs.server script runs
Solaris System Administration 165

THE SHARE COMMAND

SYNTAX
OPTIONS
ro rw root = client ro = access - list rw = access - list
Solaris System Administration 166

share [-F Fstype] [-o options] [-d description]pathname

unshare command

Command Format unshare [ -F nfs ] pathname


Options

-F nfs pathname

Solaris System Administration

167

shareall and unshareall commands

Command format
shareall [-F nfs]

unshareall [-F nfs]

Solaris System Administration

168

NFS File Server configuration

Edit the /etc/dfs/dfstab file. Start the server daemons verify the intended sharing

Solaris System Administration

169

The dfshares command

Command format dfshares [-F nfs] [ host]

Examples

#dfshares
resource
venus:/usr/share/man

server
venus

access
-

transport
-

#dfshares mars
resource
mars:/export

server
mars

access
-

transport
170

Solaris System Administration

The dfmounts command

Command format dfmounts [-F nfs]

Example

# dfmounts
Resource
-

Server
venus

Pathname
/usr/share/man

CLIENTS
earth,pluto
171

Solaris System Administration

The mount command

Command format
Options

mount [ -F ][ -o options] server : pathname mount_point

-F nfs -o options server : pathname mount_point


Solaris System Administration 172

#mount venus:/usr/share/man /usr/share/man

Entries in /etc/vfstab file

To mount remote file systems at boot


#device #to mount device mount to fsck point
-

FS fsck type pass


-

mount at boot
yes

mount options
soft.bg

venus:/usr/man

/usr/man nfs

Solaris System Administration

173

The NFS Client Setup

Displays resources currently available from server


mounts the desired resources

setups automatic mounting of the resources


unmounts the resource when it is no longer needed

Solaris System Administration

174

TROUBLESHOOTING NFS

Unknown host
rpcbind failure

server not responding


NFS client fails at reboot

stopped server error


Solaris System Administration 175

BACKUP & RESTORATION

Solaris System Administration

176

BACKUP PREPARATIONS
Preparing to back up file systems begins with planning and covers choosing :
A tape drive

Which file systems to back up


The type of backup (full or incremental)

A backup schedule
Solaris System Administration 177

UFSDUMP
TO..
Do a full backup Do an incremental backup backup individual files Specify a cartidge tape

Argument 0 option 1-9 option


Specify a file or a directory

For Example
ufsdump 0ucf /dev/rmt/0 / ufsdump 9ucf /dev/rmt/0 / ufsdump ucf /dev/rmt/0/export/home/kryton ufsdump 9ucf /dev/rmt/0/export/home/

-c option

Backup local file system to a remote system tape drive

Remote system dump file

ufsdump oucf pluto : /dev/rmt/0 /export/home

Solaris System Administration

178

FULL BACKUP of root( / )


The following example shows a full backup of root (/) file system to a QIC-150 tape(/dev/rmt/0)
# strudown -g30 -g
# ufsdump ucf /dev/rmt/0 Dump : Writing 63 Milobyte records Dump : Date of this level 0 dump : Tue Jun 09 10:13:44 1998 Dump : Date of last level 0 dump : the epoch Dump : Dumping /dev/rdsk/c0t3d0w0 (pluto:/) to /dev/rmt/0 Dump : Mapping (PANN I) [regular files] Dump : Mapping (PANN II) [directories] Dump : Estimated 73708 blocks (35.99 MB) Dump : Tape rewinding Dump : 73582 blocks(35.93 MB) on 1 volume at 100mb/sec Dump : Dump is done Dump : level 0 dump on Tue Jun 09 10:13:44 1998
Solaris System Administration 179

tar & cpio


tar
It copies files and directorie subtresss to a single tape It is available on most UNIX operating systems Public domain versions are readily available It is not awrae of filesystems boundaries The full path name length can not exceed 255 characters It does not copy empty directories or special files such as device files

Solaris System Administration

180

cpio
It copies special files or filesystems those require multiple tape volumes It packs data onto tape more efficiently than tar It skips over any bad sectors in atape while restoring It provides options for writing files with different header formats (tar, cdc, crc etc) for portability between different system tapes It creates multiple tape volumes
Solaris System Administration 181

Copying All Files in Directory to a Tape (cpio)


The following example copies all the files in the directory /export/home/kryten to the tape in the tape drive 0. $ cd /export/home/kryten $ ls | cpio -oc > /dev/rmt/0 8 blocks $ cpio -civt < /dev/rmt/0 drwxr-xr-x 2 kryten users 0 Jun 9 15:56 1998, letters drwxr-xr-x 2 kryten users 0 Jun 9 15:56 1998, memos drwxr-xr-x 2 kryten users 0 Jun 9 15:56 1998, reports 8 blocks $
Solaris System Administration 182

How to Retrieve All Files From a Tape (cpio)


1. Change to the directory where you want to put the files. 2. Insert the tape into the tape drive. 3. Copy all the files from the tape to the current directory using the cpio command. $ cpio -icvd < /dev/rmt/n Reads in the contents of the tape. specifies the cpio should read files in ASCII character -v Displays the files being retrieved in the format similar to the output from the ls command. -d Create directories as needed. < /dev/rmt/n Specifies the output file. 4. Verify the files copied by listing the contents of the current directory
Solaris System Administration 183

-i -c

How to Copy Files to a Tape (tar)


1. Change to the directory that contains the files you want to copy. 2. Insert a write-enabled tape into the tape drive. 3. Copy the files to tape with the tar command. $ tar cvf /dev/rmt/n filename ... c Indicates you want to create an archive. v Displays the name of each file as it is archived. f/dev/rmt/n Indicates that the archive should be written to the specified device or file. filename ... Indicates the files and directories you want to copy. The file names you specify are copied to the tape, overwriting any existing files on the tape. 4. Remove the tape from the drive and write the names of the files on the tape label.
Solaris System Administration

184

How to Retrieve Files From a Tape (tar)


1. Change to the directory where you want to put the files. 2. Insert the tape into the tape drive. 3. Retrieve files from the tape using the tar command. $ tar xvf /dev/rmt/n [filename ...] x Indicates that files should be extracted from the specified archive file. All of the files on the tape in the specified drive are copied to the current directory. v Displays the name of each file as it is archived. f /dev/rmt/n Indicates the tape device containing the archive. filename Specifies a file to retrieve. 4. Verify the files are copied by listing the contents of the current directory. $ ls -l
Solaris System Administration 185

Retrieving Specified Files From the Tape(cpio)

The following example retrieves all the files with the suffix chapter from the tape in drive 0.
$ cd /home/smith/book $ cpio -icv *chapter < /dev/rmt/0 Boot.chapter Directory.chapter Install.chapter Intro.chapter 31 blocks $ ls-l
Solaris System Administration 186

Media Storage Capacities


Media 1/2 inch reel tape 2.5-Gbyte 1/4 inch cartridge(QIC) tape DDS3 4-mm cartridge tape(DAT) 14-Gbytes 8-mm cartridge tape DLT 7000 1/2 inch cartridge tape Capacity 140 Mbytes (6250 bpi) 2.5Gbytes 12-24Gbytes 14 Gbytes 35-70 Gbytes
187

Solaris System Administration

Device Naming
Berkeley(Sun OS 4.x) Compatibility

/dev/rmt/XAbn
Optional No-rewind n no-rewind omit for rewind Optional Density l low m medium h high u ultra c compressed

Drive 0 1 2 3 4 n

Solaris System Administration

188

Displaying Tape Drive Status


$ mt -f /dev/rmt/0 status Archive QIC-150 tape drive: sense key (0x0) = No Additional Sense residual=0 retries=0 file no =0 block no=0 $ mt -f /dev/rmt/1 status Exabyte EXB-8200 8mm tape drive: sense key(0x0) = No Additional Sense residual=0 retries=0 file no =0 block no=0

Rewinding a Magnetic Tape Cartridge


$ mt -f /dev/rmt/1 rewind
Solaris System Administration 189

NETWORK TROULESHOOTING

Solaris System Administration

190

COMMANDS
snoop netstat ifconfig ping traceroute

Solaris System Administration

191

netstat

Shows network status Syntax


netstat [-i][-p][-r] -I interface -P protocol Options


-i -p -r -I -P shows state of the interface. shows ARP tables Routing tables or static routes shows states of a particular interface statistics of a particular protocol

Solaris System Administration

192

snoop
Used for capturing & inspecting network packets. Can only be run by supervisor. Displays contents of highest level protocol e.g. Examine Broadcast packets # snoop broadcast Using device -d (promiscous mode) mach 1 -- 128.50.255.255 RUSERS C mach 5 -- 128.50.255.255 RUSERS C -v verbose can be used for detailed information

Solaris System Administration 193

ifconfig

Configure IP address to a network interface. Display status.

# ifconfig -a

Syntax :
ifconfig<interface_name><ipaddress> up/down

Solaris System Administration

194

ping

Used to check network connectivity Uses Icmp Syntax : ping [-s] -I[internal] host -s -- continuously sends data packets.

Solaris System Administration

195

traceroute

Prints the route taken by ICMP packets to reach a network host from another

Used to check fault on a network Syntax : #traceroute <ip address of the destination host)
Solaris System Administration 196

LP PRINT SERVICES

Solaris System Administration

197

PRINT SERVICE ARCHITECTURE

Client-server model

Print server Print client

Printing System

Print service software Sunsoft Print client software Print filters Hardware
Solaris System Administration 198

SOLARIS 7 PRINT SOFTWARE


Print protocol adaptor SunSoft Print Client

Network printer support


LP administration and print commands

Solaris System Administration

199

LP PRINT SERVICE DIRECTORIES


Directory
/usr/bin /etc/lp /usr/share/lib /usr/sbin
/usr/lib/lp

Contents
The LP print service user commands. LP server configuration files. The terminfo database directory. The LP print service administration commands. LP daemons, directories for binary files, and PostScriptfilters. LP daemon logs Spooling directory for pending requests.
Solaris System Administration 200

/var/lp/logs /var/spool/lp

PRINT FUNCTIONS

Queuing Tracking

Fault notification
Initialization

Filtering
Solaris System Administration 201

PRINTER TYPES AND INTERFACE PROGRAMS


Matching print requests to printers Determining printer types Checking for defined printer types # ls /user/share/lib/terminfo/e
ep2500+high ep2500+low ep40 ep400 ep4080 ergo4000 epson2500 epson2500-80 epson2500-hi epson2500-hi80

Using interface programs


Solaris System Administration 202

PRINTING ENVIRONMENT

Local Printer Remote Printer

Solaris System Administration

203

FINDING THE PRINTER

Determining the printer name

The command-line interface


The users PRINTER or LPDEST

environmental variables for a default printer

_default in $%HOME/.printer _default in /etc/printer.conf _default in a network name services database


Solaris System Administration 204

LOCAL PRINT MODEL


lp/lpr
Lpsched schedules print request

lpsched
Selects printer /var/spool/lp/requests/system /var/spool/lp/tmp/system

Filter request

Interface Program

DOCUMENT
PRINTER
Solaris System Administration 205

REMOTE PRINTING

inetd

In.lpd

lpsched

To printer

Spool area

Solaris System Administration

206

CONFIGURING PRINT SERVICES

Setting up the printer


Setting up the print server Setting up the print client
Solaris System Administration 207

PRINT SERVER REQUIREMENTS

Minimum of 20-25 Mbytes in spooling directory.

At least 32 Mbytes of RAM. Enough swap space to augment RAM and support print services.

Solaris System Administration

208

lp command
Command Name lp lpstat cancel lpadmin accept reject lpmove enable disable Description Sends file to a printer Displays print service status Cancels print requests Performs various administration tasks Enables queuing of print requests Prevents queuing of further print requests Moves print requests Enables printer to print requests Disables printer from printing requests
Solaris System Administration 209

lpstat command
Used to display a users print queue Syntax :

lpstat [-options]
-a -d -o -p Reports whether print destinations are accepting requests. Displays the name of the default printer. Displays the status of all output requests on printers. Displays the idle or busy status and availability of all printers. Determines what printers are configured for the system on which you are working. Displays all status information, the combined output of all other options, plus the list of queued print requests.
Solaris System Administration 210

-s -t

PRINTER ADMINISTRATION COMMANDS

Designating a default destination

# lpadmin -d sparky
# lpstat -d system default destination: sparky

Setting a user default printer variable (Bourne shell)


$ LPDEST=spock; export LPDEST Setting a user default printer variable (C Shell)

venus % setenv LPDEST spock

Solaris System Administration

211

TROBLESHOOTING A PRINTER

Check the status of the queues.

$ lpstat -o

Stop and restart daemons.

# /etc/init.d/lp stop
# /etc/init.d/lp start

Print services started.


Solaris System Administration 212

JUMPSTART INSTALLATIONS

Solaris System Administration

213

NETWORK INSTALLATION
Servers Required

Install Server
Boot Server

Name Server

Solaris System Administration

214

INSTALL SERVER
Creating Install Server

Sun System with CD ROM as install Server


Mount CD ROM Drive

Run setup_install_server
eg ./setup_install_server /export/install

Solaris System Administration

215

BOOT SERVER
Creating Boot Server

Sun System with CD ROM as Boot Server


Mount CD ROM Drive Run setup_install_server -b eg ./setup_install_server -b /export/install

Boot server is only required if the install server is on another subnet


Solaris System Administration 216

ADDING CLIENTS
add_install_client

-c server:jumpstart_dir_path
-s install_server:install_dir_path -e ethernet address -p server:sysidcfg_path host_name

platform_group

Solaris System Administration

217

TASKS

Create Jump start directory on the server

Enable all clients to access that directory


Creating Profiles

Creating a rules file


Using check to validate the rules file

Solaris System Administration

218

Creating a jumpstart directory

Create Jump start directory on the server

eg mkdir /jmpstart

Share this directory

eg add share -F nfs -o ro,anon=0 /jmpstart in


/etc/dfs/dfstab file followed by unshareall and shareall

Solaris System Administration

219

Creating a jumpstart directory

Copy the contents of auto_install_sample

directory from Solaris CD into the jumpstart


directory

eg cp -r auto_install_sample/* /jmpstart

Solaris System Administration

220

Accessing jumpstart directory


Two ways of making client access the jumpstart directory

Using -c option of add_install_client command


everytime system is added for network installation

Editing the bootparams file and updating the name service if required

eg * install_config=server:jumpstart_dir_path

Solaris System Administration

221

What is a profile?

Profile is a text file used as a template by the

custom jump start installation software

It defines how to install solaris software on a system

It consists of one or more profile keywords and their values

Solaris System Administration

222

Requirements for profiles


The install_type profile keyword is required

Only one profile keyword can be on a line

Solaris System Administration

223

Creating profile

Create a new file or edit one of the sample

profiles in the jumpstart directory

Profile keywords and their values are case sensitive

profile should be owned by root and have permissions equal to 644

Solaris System Administration

224

Profile Examples
# Profile keywords profile values install_type system_type partitioning filesys cluster package initial_install standalone default any 60 swap SUNWCall SUNWman delete
Solaris System Administration 225

Rules file

Rules file is a text file used to create the

rules.ok file

Rules file is a look-up table consisting of one or more rules that define matches between system attributes and profiles

Solaris System Administration

226

Creating Rules file

Create a new file with name rules or edit the

existing rules file in jumpstart directory

Add a rule in the rules file for each group of systems that need to be installed

The rules file must have at least one rule Rule must have at least a rule keyword, a rule value, and a corresponding profile
Solaris System Administration 227

Syntax
[!] rule_keyword rule_value [&& [!] rule_keyword rule_value] begin profile finish

! Symbol used to indicate negation

[] indicates an optional expression or field


rule_keyword - predefined keyword that

describes a general system attribute such as


host name or memory size
Solaris System Administration 228

Syntax(Contd.)

Rule_value- Value that provides the specific system attribute for the corresponding rule keyword

&& Symbol used to logically AND

begin - name of an optional bourne shell script


that can be executed before the installation

begins. If no begin script exists, enter a minus


sign(-) in this field
Solaris System Administration 229

Syntax(Contd.)

Profile- Name of text file used as a template that defines how to install solaris on a system

finish- Name of an optional bourne shell script that can be executed after the installation

completes

Solaris System Administration

230

Rule Example
Rule keyword and value begin script profile finish script

hostname noida-1

prof1

memsize 16-32 &&


arch sparc any

prof2

genprof

Solaris System Administration

231

Rules file

Rules file must have file name rules Rules.ok file is a generated version of the rules file and is required by the jumpstart installation software to match system to a profile

rule_value, begin and finish fields must have a


valid entry or a minus sign

Solaris System Administration

232

Important rule keyword


Hostname karch memsize network

Solaris System Administration

233

Check file

Check script is used to validate the rule and profile file. It does the following

Checks the rule file for syntax check the profile file for syntax If no errors are found, check creates the rule.ok file

./check -r file_name
Solaris System Administration 234

Check file

Check script is used to validate the rule and profile file. It does the following

Checks the rule file for syntax check the profile file for syntax If no errors are found, check creates the rule.ok file

./check -r file_name
Solaris System Administration 235

NIS+

Solaris System Administration

236

What is NIS+?

Network name service that stores information such as workstation addresses, security information, mail information, ethernet interface information at a central location

where all workstations on a network can access


it

It uses client server model to store and


access information
Solaris System Administration 237

What is NIS+?

Each domain is supported by a set of servers Prinicipal server is called the master server Backup server is called replica server Network information is stored in 16 standard NIS+ tables

Changes made to the NIS+ data on the master server are automatically propagated to the replicas
Solaris System Administration 238

Name Service Switch

It controls how the client obtains network information

Switch is called nsswitch.conf and is stored in the /etc directory

Solaris System Administration

239

Nsswitch.conf file

This file identifies a particular type of network information, such as host, password and group, followed by one or more sources, such as NIS+ tabkes, dns or local /etc

This file is loaded in every workstations


/etc directory along with three template

versions viz nsswitch.nisplus, nsswitch.nis


and nsswitch.files
Solaris System Administration 240

NIS+ Scripts

Three NIS+ scripts are required to set up a NIS+ namespace

nisserver nispopulate nisclient

Solaris System Administration

241

Configuring NIS+

Solaris System Administration

242

Setting up Root Servers


Defaults used in root server Security level 2(DES) System information files(/etc) as the source of name service information

admin.domainname is the default NIS+ group

Solaris System Administration

243

Setting up Root Servers(Contd.)

Set the superusers PATH variable to include /usr/lib/nis

If using DES authentication, specify the diffiehellman key length eg nisauthconf dh640-0 des

Run nisserver to configure a root master server

nisserver -r -d nis_domainname

Solaris System Administration

244

Populating NIS+ tables


Check for no spurious entries in /etc files Remove all dots and underscores in host names Better make copies of /etc files and populate only the information you want to populate

Domain must have been configured and its


master server must be running

Run nispopulate -F -p /nis+files -d


domain_name
Solaris System Administration 245

Setting up NIS+ Client

Domain must have been configured and master server must be running

Master server of the domains tables must be


populated

Log in as super user on the machine that is


going to become NIS client

Solaris System Administration

246

Setting up NIS+ Client(Contd.)

Specify the Diffie-Hellman key length On the master server type nisauthconf. Use the output of this as an argument to nisauthconf on the client

Run nisclient on the client machine


nisclient -i -d domain_name -h root_server

Solaris System Administration

247

Initializing NIS+ Client Users

The domain must have been configured and its master server must be running

The master server of the domains table must be


populated

Log in as a user on the client machine


If using DES authentication, the client machine

must use the same Diddie-Hellman key


configuration
Solaris System Administration 248

Initializing NIS+ Client Users

Run the following command on the client machine

nisclient -u

Solaris System Administration

249

NIS+ Servers

Client machines can be changed into NIS+ servers of the following types

Root Replicas- to contain copies of the NIS+


tables that reside on the root master server

To be master servers of subdomains of the root


domain

To be replicas of master servers of subdomains


of the root domain
Solaris System Administration 250

NIS+ Servers

Run the following command on the client machine

rpc.nisd

Solaris System Administration

251

Root Replica

The domain must have been configured and its master server must be running

The tables of master server must be populated


rpc.nisd must be started on the replica server

Log in as root on the root master server

Solaris System Administration

252

Root Replica

Run the following command on the root master server

nisserver -R -d domain_name -h client_name

Solaris System Administration

253

Creating Subdomain

The parent domain must have already been configured and its master server must be

running

The parents domains tables must be populated

New client machine must have been initialized


rpc.nisd must be running on the client

Log in as root on the parent master server


Solaris System Administration 254

Creating Subdomain

Run the following command on the master server

nisserver -M -d new_domain -h client_name


where client_name is the name of the client

machine that will become the root domain

Solaris System Administration

255

Populating Subdomains tables

Run the following command on the new subdomain server

nispopulate -F -p /nis+files -d new_domain

Solaris System Administration

256

You might also like