Escolar Documentos
Profissional Documentos
Cultura Documentos
SYSTEM CONCEPTS
Pradip Gudale 1
Operating System
• Definition : Set of programs that manage
all computer operations and provides an
interface between the User and the System
Resources
• Main parts of OS are Kernel, Shell and File
structure
Pradip Gudale 2
Kernel
• Manages devices, memory processes and
daemons
• controls the functions (transfer) between
programs and hardware
• schedules & executes processes
• Manages swap & daemons
Pradip Gudale 3
H/W
KERNEL
Shell
Pradip Gudale 4
OS shells
• Bourne shell ($) : default, AT & T Unix
• C shell (%) : similar features as Korn shell
• Korn shell ($) : superset of Bourne shell;
adds aliasing, history and command line
editing
Pradip Gudale 5
FS structure
• Directory hierarchy
• topmost directory is root
• /usr, /opt, /dev, /export/home, /kernel
(genunix resides here)
Pradip Gudale 6
termionology
• Host : a computer system
• host name : unique; each on network must have
hostname
• Ip address : number used by networking s/w
• client : host that uses services from other hosts
• server : host that provides service
• network : group of connected hosts
Pradip Gudale 7
Examples of server
• File server
• print server8
• boot server
• install server
• name server
• mail server
Pradip Gudale 8
PART 1:
Pradip Gudale 9
Solaris Users and Groups
• role-based access control (RBAC)
provides a flexible way to package
superuser privileges
• Special type of User Account called
“Role”
Pradip Gudale 10
User Account Information
• User Name
• Password
• User’s Home Directory
• Initialization Files
Pradip Gudale 11
User => Group
• You add a User to a particular Group
• This is to give access for a particular file or
directory to a set of users
Pradip Gudale 12
User ID Numbers Login Accounts Reserved For …
---------------------------------------------------------------
Pradip Gudale 13
PASSWORD
• Password aging feature
• must be changed after specified period
• cannot be changed within specified period
Pradip Gudale 14
Home directories
• Usually /export/home/username
• Can be on local m/c or file server
• accessed via /home/username
• if automounter is used it does not allow you
to vreate anything under /home
Pradip Gudale 15
User’s Initialization Files
• .login
• .cshrc
• .profile
• System initialization files are /etc/.login and
/etc/profile
Pradip Gudale 16
Groups…. Each group to have
• group name
• group ID
• list of users that belong to the group
Pradip Gudale 17
groups
• Each user can be assigned to two types of
groups…. 1 Primary and 16 secondary
• Files created by user are assigned GID of
the group the user primarily belong to
• secondary group not important for files….
It is useful for some applications like
admintool which expects user to belong to
sysadmin group GID 14
Pradip Gudale 18
Groups
• groups command lists all groups user
belongs to
• primary group of the user can be
temporarily changed using newgrp
command to any other group user is a
member of
Pradip Gudale 19
Management of users and groups
• Local system… use admintool with CDE or
commands like useradd, groupadd etc
• local/remote system… use adminsuite with
CDE
Add a User Account
NIS+ nistbladm & nisclient
NIS useradd & make
None useradd
Pradip Gudale 20
Where information is stored ?
• /etc/passwd and /etc/shadow
• username:password:uid:gid:commen
t:homedirectory:login-shell
• e.g. root:x:0:1:Super
User:/:/sbin/sh
rimmer:86Kg/MNT/dGu.:8882:0::5:20:8978
• e.g.
Pradip Gudale 21
PART 1:
Initialization Files
Pradip Gudale 22
Initialization Files
example of .profile
PATH=$PATH:$HOME/bin:/usr/local/bin:/usr/c
cs/bin:. 1
MAIL=/var/mail/$LOGNAME 2
NNTPSERVER=server1 3
MANPATH=/usr/share/man:/usr/local/man 4
PRINTER=printer1 5
umask 022 6
export PATH MAIL NNTPSERVER MANPATH
PRINTER 7
Pradip Gudale 23
Customization of Environment
• Solaris provides template files in /etc/skel
• For Bourne Shell /$HOME/.profile
• For C Shell /$HOME/.cshrc and
/$HOME/.login
• For korn Shell .profile and /$HOME/$ENV
Pradip Gudale 24
/etc/skel
C Shell /etc/skel/local.login
/etc/skel/local.cshrc
Pradip Gudale 25
BOURNE C Shell Korn Shell
Job control Yes Yes Yes
History list No Yes Yes
No Yes Yes
No Yes Yes
No Yes Yes
ng
No Yes Yes
d
No Yes
No Yes Yes
from
No
Pradip Gudale Yes
26
No Yes No
Shell environment
• Environment variables : upper case .. Use
setenv command
• shell (local) variables : lower case.. Use
set command. E.g. user term home and
path
• C shell setenv VARIABLE value
• Bourne or Korn shell
VARIABLE=value; export
VARIABLE Pradip Gudale 27
Environment variables
• LPDEST Sets the user’s default printer.
• MAIL Sets the path to the user’s
mailbox.
• MANPATH Sets the hierarchies of man
pages available.
• OPENWINHOME Sets the path to the
OpenWindows subsystem.
Pradip Gudale 28
Variables… cntd
• prompt Defines the shell prompt for
the C shell.
• PS1 Defines the shell prompt for the
Bourne or Korn shell.
• SHELL (or shell in
• the C shell)
• Sets the default shell used by make, vi,
and other tools.
Pradip Gudale 29
Variables.. cntd
• PATH=/usr/bin:/usr/sbin:/opt/SUNWmd/
• CDPATH=/export/home/rajiv
• TERM (or term in the C shell) Defines
the terminal. This variable should be
reset in /etc/profile or
/etc/.login. When the user invokes
an editor, the system looks for a file with
the same name as the definition of this
environment variable.
Pradip Gudale 30
umask
Default permissions given for file
or directory when created, by
subtracting umask value from 666 or
777
file directory
0 rw rwx
1 rw rw
2 r rx
3 r r
4 w wx
5 w w
6 x x
Pradip Gudale 31
7 (none) (none)
PART 1:
Pradip Gudale 32
Booting & Shutdown
• What’s new in this release ?
• What was the method used earlier ?
• How do we boot Intel Platform Solaris ?
Pradip Gudale 33
Terminology
• init state
• run level
• Which process helps change run-levels
Pradip Gudale 34
Types of Boot
• Interactive
• Reconfiguration
• Recovery
Pradip Gudale 35
Shutdown commands
• init
• shutdown
Pradip Gudale 36
When do you need to change
run_levels ?
• Add new h/w
• backup-restore
• retune kernel parameters
• repair system configuration file
• known power outage
Pradip Gudale 37
Run control
Pradip Gudale 38
Current run level ?
$ who -r
. runlevel 3 Sep 1 14:45 3 0 S
Since when ?
Pradip Gudale 40
/etc/inittab entries
Each entry in the /etc/inittab file has the
following fields:
id:rstate:action:process
Unique id
Applies to these
run levels
Pradip Gudale 44
Sample /etc/rc2.d
# ls /etc/rc2.d
K07dmi S70uucp S75cron S91afbinit
K07snmpdx S71ldap.client S75flashprom
S91ifbinit K28nfs.server S71rpc
S75savecore S92volmgt README
S71sysid.sys S76nscd S93cacheos.finish
S01MOUNTFSYS S72autoinstall S80PRESERVE
S94ncalogd
S05RMTMPFILES S72inetsvc S80lp
S95IIim
S20sysetup S72slpd S80spc S95amiserv
S21perf S73cachefs.daemon S85power
S95ocfserv
Pradip Gudale 45
Adding scripts
Pradip Gudale 46
Adding scripts….
# cp filename
# cp /etc/init.d
filename /etc/init.d
# chmod 0744 /etc/init.d/filename
# chmod 0744 /etc/init.d/filename
# chown root:sys /etc/init.d/filename
# chown root:sys /etc/init.d/filename
# cd /etc/init.d
# ln filename /etc/rc2.d/Snnfilename
# ln filename /etc/rcn.d/Knnfilename
Pradip Gudale 47
Summary of rc scripts
Pradip Gudale 48
/sbin/rc1
Stops system services and daemons
Pradip Gudale 49
/sbin/rc2
Mounts all local file systems
Enables disk quotas if at least one file system was mounted with
the quota option
Saves editor temporary files in /usr/preserve
Removes any files in the /tmp directory
Configures system accounting
Configures default router
Sets NIS domain and ifconfig netmask
Reboots the system from the installation media or a boot server if
either /.PREINSTALL or /AUTOINSTALL exists
Starts inetd and rpcbind and named, if appropriate
Pradip Gudale 50
/sbin/rc2…… cntd
Pradip Gudale 51
/sbin/rc3
bin/rc3 Runs the /etc/rc3.d scripts to perform the following tas
Cleans up sharetab
Starts nfsd
Starts mountd
If the system is a boot server, starts rarpd, rpc.bootparamd, and
rpld
Starts snmpdx (Solstice Enterprise Agents
TM
process).
Pradip Gudale 52
/sbin/rc5 and /sbin/rc6
/sbin/rc5 and /
sbin/rc6
Runs the /etc/rc0.d/K* scripts to perform the following tasks:
Kills all active processes
Unmounts the file systems
Pradip Gudale 53
/sbin/rcS
Pradip Gudale 54
Shutdown commands
• Shutdown
• init
• reboot
• halt
Pradip Gudale 55
PART 1:
Pradip Gudale 56
Prom monitor
>n
OK
Pradip Gudale 57
Prom monitor
Pradip Gudale 58
Prom monitor : important
commands
• printenv
• setenv
• probe-scsi-all
• reset
Pradip Gudale 59
Boot command
-a
-s
-r
………….Try it out
Pradip Gudale 60
Boot over a network
• Need to set up a boot server
• rarp or dhcp protocols
• for dhcp PROM version must be > 3.25
• ok nvalias net
/pci@1f,4000/network@1,1:dhc
p
Pradip Gudale 61
Stop system for recovery
Pradip Gudale 62
Intel Solaris
Solaris Boot Diskette
Solaris Installation CD
Pradip Gudale 63
Boot process
Pradip Gudale 64
What all does a PROM do ?
Pradip Gudale 65
Boot phases
• Boot prom phase
• boot program phase
• kernel initialization phase
• init phase
Pradip Gudale 66
Boot phases
Boot prom :the PROM loads the primary boot program,
bootblk
bootblk program finds and executes the secondary
boot program, ufsboot, and loads it into memory.
Pradip Gudale 68
Volume Management
Major Benefits
Pradip Gudale 69
/etc/init.d/volmgt
• automatically mounts diskettes and
CDs
• enables you to access diskettes and
CDs without having to become
superuser.
• allows you to give other systems on the
network automatic access to any
diskettes and CDs you insert into your
system Pradip Gudale 70
Manual mounting
Steps Manual Mounting Automatic Mounting
1 Insert media.
2 Become superuser.
3 Determine the location of the media device.
4 Create a mount point.
5 Make sure you are not in the mount point directory.
6 Mount the device using the proper mount options.
7 Work with files
8 Become Superuser and unmount
9 Eject media
Pradip Gudale 71
How to access from FDD/CD
enter floppy and run volcheck
Files on a diskette or Raw data on a diskette
access through /vol/dev/aliases/floppy0
File Systems on floppy
access through /floppy/floppy0
Pradip Gudale 72
Files copied from CD
Remember……..
Files copied to disk will not have write permissions
WHY ?
Pradip Gudale 73
How do you find who are using
the CD ?
# fuser -u [-k] /cdrom/cdrom0
Pradip Gudale 74
..How do you use CDROM
connected to another M/C ?
Prerequisite ?
CDROM on
other M/C must
be shared..
Pradip Gudale 75
$ showmount -e system-name
export list for system-
name:
/cdrom/sol_8_sparc
(everyone)
Become a superuser
Pradip Gudale
…….Try this out
76
..How do you make CDROM on
your system available to other
systems ?
Basically…. It-must-be-shared
Pradip Gudale 77
STEPS …..
# mkdir /dummy
# vi /etc/dfs/dfstab
( Add the following line:)
share -F nfs -o ro /dummy
# eject cdrom0
# chmod 644 /etc/rmmount.conf
# vi /etc/rmmount
( Add the following line to the File
System Sharing section:)
share cdrom*
# chmod 444 /etc/rmmount.conf
( Load a CD.)
# share
Pradip Gudale 78
Configure a System to Play
Musical CDs
Edit /etc/rmmount.conf and add action line
# Actions
action cdrom action_workman.so path/workman
Workman-options
path The dir in which you have placed the Workman S/W
# /etc/init.d/volmgt start
# /etc/init.d/volmgt stop
Pradip Gudale 80
Formatting floppies ...tasks
• Load unformatted diskette
• Format diskette for dos
• Format diskette for ufs
• make ufs FS
Pradip Gudale 82
Can format to 7 densities
• 3.5” Extended • 5.25” High Density
Density 2.88 Mbytes (HD) 1.2 Mbytes
• 3.5” High Density • 5.25” Medium
(HD) 1.44 Mbytes Density (DD) 720
• 3.5” Medium Density Kbytes
(DD) 1.2 Mbytes • 5.25” Low Density
• 3.5” Low Density 360 Kbytes
720 Kbytes
Pradip Gudale 83
Formatting defaults...
• the diskette drive formats a diskette to a
like density unless instructed otherwise
• a diskette can be formatted to its
capacity or lower
• a drive can format to its capacity or
lower
Pradip Gudale 84
Use fdformat command with
density option….
To Format In A Drive fdformat Density
a diskette as of option
Pradip Gudale 86
Formatting for ufs FS
-e eject
-f force ..no questions
Unmount if mounted
-b label
Pradip Gudale -z just show options 87
How to Place a UFS File
System on a Diskette ?
Type of FS
ufs taken as
default
Pradip Gudale 88
Creating FS
/usr/sbin/newfs -v /vol/dev/aliases/floppy0
Displays status
Pradip Gudale 89
Auto mounting
Invoke the volrmmount command using the −i
option to notify Volume Management that the diskette is
inserted.
$ volrmmount -i floppy0
Pradip Gudale 90
Formatting for DOS
$ fdformat -v -U [density-options convenience-
options]
Pradip Gudale 91
Things to remember
• volcheck -v command to notify volume
management
• floppy0 is symbolic link to floppy name
• if nothing is found under /floppy it means
floppy not mounted or not formatted
• /floppy is same as /vol/dev/diskette0
• fuser -u [-k] floppy0 to find user and [kill]
• if formatted but without name system refers
to it as unnamed_floppy
• # ls /floppy/floppy0 to see
Pradip Gudale 92
How to use floppy put in another
M/C’s floppy drive ?
Same as CDROM …… except…...
# File System Sharing
share floppy*
Pradip Gudale 93
How
Volume Management
works?
Pradip Gudale 94
Volume management
• All removable media made available under
/vol/dev
/vol/dev
Pradip Gudale 95
Volume management
/vol/dev
dsk rdsk
c0t6 c0t6
cdrom drive
Pradip Gudale 97
CDROMs
/vol/dev
dsk rdsk
c0t6 c0t6
cdrom drive
cd name cd name
Pradip Gudale 98
To make access more convenient, Volume Management uses
two special mount points, /floppy and /cdrom.
floppy cdrom
/cdrom/cdrom0 > /cdrom/cd-name >
/vol/dev/dsk/c0t6d0/cd-name
The symbolic links for file system access simply link the
directories /floppy/floppy0 and /cdrom/cdrom0 to the
diskette inserted into the first diskette drive and the CD
inserted into the first CD-ROM drive:
/vol/dev/aliases/floppy0 >
/vol/dev/rdiskette0/diskette-name
/vol/dev/aliases/cdrom0 >
/vol/dev/rdsk/c0t6d0/cd-name
use /vol/dev/aliases/floppy0 or
/vol/dev/aliases/cdrom0 link names.
ISO 9660
UFS : Sparc
UFS : Intel
$ ls /cdrom/cdrom0
S0 S2
$ ls /vol/dev/dsk/c0t6
S0 S2
SOFTWARE
ADMINISTRATION
Keeps track of
what is installed
Default…
/var/spool/pkg
# pkgchk -v pkgid
# pkgadd -d
/cdrom/sol_8_sparc/s0/Solaris_8/Product
-s /var/spool/pkg SUNWaudio
# pkgadd SUNWman
contents
Always use
#pkgrm [-s spooldir] pkgid
Do not use “rm” to remove
package files….. WHY ?
Be either super-user
or
member of sysadm group
Pradip Gudale 131
patches
• What are they ?
• How are they distributed ?
• How are they numbered ?
• What happens when you install patches ?
• What happens when you remove patches ?
Login as anonymous
password as complete e-mail address
pickup patches from
/pubs/patches directory.
Transfer mode :
binary Pradip Gudale 136
Patch numbering
106925–02
hyphen
Patch revision
DISK
MANAGEMENT
Part Tag Flag Cylinders
Size Blocks
0 root wm 0 300
148.15MB (301/0/0) 303408
1 swap wu 301 524
110.25MB (224/0/0) 225792
2 backup wm 0 2035
1002.9MB (2036/0/0) 2052288
3 unassigned wm 0
0 (0/0/0) 0
Pradip Gudale 156
sectors
# prtvtoc /dev/rdsk/c0t1d0s0
* /dev/rdsk/c0t1d0s0 partition map
* Dimensions:
* 512 bytes/sector
* 72 sectors/track
* 14 tracks/cylinder
* 1008 sectors/cylinder
* 2038 cylinders
* 2036 accessible cylinders
* Flags:
* 1: unmountable
* 10: readonly
* First
Sector Last
* Partition Tag Flags Sector Count
Sector Mount Directory
0 2 00 0
Pradip Gudale 157
Formatting a disk
For Intel:
# installboot
/usr/platform/i86pc/lib/fs/ufs/pboot
/usr/platform/i86pc/lib/fs/ufs/bootblk
/dev/rdsk/c0t6d0s2
Pradip Gudale 160
Recovering corrupted disk label
Step 1: is to put back disk geometry
automatic configuration
or
manual disk type specification. Select disk type number.
automatic configuration
or
manual disk type specification. Select disk type number.
Enter defective block number: 12345
Enter defective block number: 34/2/3
# format
format> analyze
analyze> setup .. Select parameters
Starting block
loop
Stop on first error
Assign alternate block
Typically,
network-based file systems reside on one system,
typically a server, and are accessed
by other systems across the network.
NFS
is the only available network-based or
distributed computing file system.
Memory based
most of them do not use disk
space
cachefs and tmpfs do
mount
volcopy Lists file names
newfs with inode nos
labelit
to NIS+)
/usr
4lib SunOS 4.1 binary compatibility package libraries
5bin Symbolic link to the /usr/bin directory
X Symbolic link to the /usr/openwin directory
adm Symbolic link to the /var/adm directory
aset Directory for Automated Security Enhancement Tools
(ASET) programs and files
bin Location for standard system commands
ccs C compilation programs and libraries
demo Demo programs and data
dict Symbolic link to the /usr/share/lib/dict directo
which contains the dictionary file used by the UNIX spell
program
dt Directory or mount point for CDE software
games An empty directory, which is a remnant of the SunOS 4.
4.1 software
Pradip Gudale 192
Under /usr
include Header files (for C programs, etc.)
java* Directories containing Java prog and libraries
kernel Additional kernel modules
kvm Implementation architecture-specific
binaries and libraries
lib Various program libraries, architecture-
dependent
databases, and binaries not invoked directly by
the user
local Commands local to a site
mail Symbolic the /var/mail directory
man Symbolic link tolink
the to
/usr/share/man directory
net Directory for network listener services
news Symbolic link to the /var/news directory
oasys Files pertaining to the Form and Menu Language
Pradip Gudale 193
Interpreter (FMLI) execution environment
old Programs that are being phased out
openwin Directory or mount point for OpenWindows S/W
perl5 Perl 5 programs and documentation
platform
preserve Symbolic link to the /var/preserve directory
proc Directory for the proc tools
pub Files for online man page and character
processing
sadm Various files and directories related to sys
admin
sbin Executables for system administration
sbin/static Statically linked version of selected
programs from /usr/bin and /usr/sbin
share Architecture-independent sharable files
share/lib Architecture-independent databases
share/src Source code for kernel, libraries, and utilities
snadm Programs andPradip
libraries
Gudale
related to system and
194
Under /usr
spool Symbolic link to the /var/spool
directory
src Symbolic link to the share/src
directory
tmp Symbolic link to the var/tmp
directory
ucb Berkeley compatibility package
binaries
ucbinclude Berkeley compatibility package header
files
ucblib Berkeley compatibility package
libraries
vmsys Directory
Pradipfor Framed Access
Gudale 195
Command Environment (FACE)
/platform &
/usr/platform Dir
/platform Contains a series of
directories, one per supported
platform that need to reside in the
root (/) file system.
/platform/*/kernel Contains platform-dependent
kernel components, including
the file unix, the core kernel that is
/usr/platform Contains platform-
platform dependent.
dependent objects that do not
need to reside in the root (/).
/usr/platform/*/lib Contains platform-dependent
objects similar to those found in
the /usr/lib /platform/*/sbin Contains
platform-dependent objects Pradip Gudale similar
196
/var/run in Solaris 8
Create UDF FS
# mkfs -F udfs /dev/rdsk/device-name
MOUNTING FS
usr /opt
file2
$ more /etc/vfstab
#device device mount FS
fsck mount mount
#to mount to fsck point
type pass at boot options
/dev/dsk/c0t0d0s0 /dev/rdsk/c0t0d0s0 /
ufs 1 no
/proc
/proc proc no
/dev/dsk/c0t0d0s1
Pradip Gudale 211
swap no
NFS features
• File resource on server and others share it;
server maintains list of shared resources
• actual loaction of resource irrelevant to user
• commonly used sharable s/w is accessed
through nfs e.g. man files
• upgradation/change to resource can be
easily managed
Pradip Gudale 212
autofs mounting for NFS
• Client side service in NFS
• resource gets mounted when you access it
• remains mounted as long as you are in it
• gets unmounted when not used for ... Time
• boot time saved
• user need not know root passwd to mount
• n/w trafic reduced
Pradip Gudale 213
autofs serviced by...
• Autofs service … automountd
• can specify alternate server to mount same
FS
• can use NIS, NIS+ or files
• /home is usually auto-mounted
Swap /export/test tmpfs
yes Pradip Gudale 218
Creating loop back FS
/ /tmp/newroot lofs
yes Pradip Gudale 219
MOUNTING
FILE SYSTEMS
# cd mount-point
# find . -xdev -size +20000000 -exec
ls -l {} \;
File System
structure
Cylinder groups
Addressable
blocks
UFS has 4 types
Pradip Gudale 233
Ufs blocks
• Boot block : info for booting; only in first
cylinder group;cyl 0; 8k size
• super block : info on file system
• inodes : info on file
• data block : data inside the file
uid
8k data block
8k data block
12 direct
pointers 8k data block
8k data block
Indirect pointer
2k pointers
Cylinder Group Map Superblock
Inodes
Cylinder Group Map
Storage Blocks
Inodes
Storage Blocks
-b bsize
-f fragsize
-c cgsize Cylinder per cyl group
-m free
..etc see man page
Pradip Gudale 246
PART 1:
FSCK
# fsck -m /dev/rdsk/c0t0d0s6
** /dev/rdsk/c0t0d0s6
ufs fsck: sanity check:
/dev/rdsk/c0t0d0s6 needs checking
To check FS interactively….
#fsck
Monthly Monday Tuesday Wednesday Thursday
Friday
0 9 9 9
9 5
9(Mon) 9 9 9 5(Fri)
Wk 1 ab abc abcd abcde abcdef
Wk 2 g gh ghI ghij a b c d e f g h i jk
In this scheme …
How many tapes will be required?
What tapes are required to restore ?
Pradip Gudale 267
Answers..
With this schedule, you need six tapes (if you want
to reuse daily tapes), or nine tapes (if you want to
use four different daily tapes): one for the level 0,
four for the Fridays, and one or four daily tapes.
Monthly Monday Tuesday Wednesday Thursday
Friday
0 3 4 5
6 2
1st of Month 0
Week 1 9 9 9 9 3
Week 2 9 9 9 9 4
Week 3 9 9 9 9 5
Week 4 9 9 9 9 6
1st of Month 0
Week 1 3 4 5 6 2
Week 2 3 4 5 6 2
Week 3 3 4 5 6 2
Week 4 3 4 5 6 2
Week 1 ab cd e f abcdef
Week 2 gh i jk lm abcdefghijklm
/usr/sbin/ufsdump [options][arguments] files-
to-back-up
0-9,a,b,c,d,D,f,s,u,v
destination
archive To diskette
Tape density
To cartridge
i,r,R,x,t
table
extract
Resume restoring; restarts from checkpoint when full
restore interrupted
recursive
Unconditional
older will replace newer
X is Drive number 0 1 2 3 4 n etc
Optional l m h
u c
Density low medium high ultra
compressed
PRINTER ADMINISTRATION
PostScript (PSR).
terminfo
• /usr/share/lib/terminfo :
printer capabilities and
initialization control data
for each printer
• cd /usr/share/lib/terminfo/e
• ls
• $ ls
• emots ep2500+high ergo4000
Pradip Gudale 319
File content type & print filters
• File content type tells print service type
of file contents that gets printed directly
without requiring modification
• Print filters convert the content type of a
file to a content type that is acceptable
to the destination printer.
• specify the file content type for a printer
by using the lpadmin I
e.g. lpadmin p .. I
Pradip Gudale 320
Solaris print manager
• You need bit mapped display
• running X-windows or CDE
• run it from CDE workspace menu OR
• #
/usr/sadm/admin/bin/printmgr
& pkg SUNWppm must be
installed
Pradip Gudale 321
Adding through lpadmin..example
# chown lp /dev/term/b
# chmod 600 /dev/term/b On server
# lpadmin -p luna -v /dev/term/b
# lpadmin -p luna -T PS -I postscript
# lpadmin -p luna -D “training-lab-ps”
# accept luna
destination ‘‘luna’’ now accepting
requests
# enable luna
printer ‘‘luna’’ now enabled
# lpstat -p luna
printer luna is idle. enabled since Jul 12
Pradip Gudale 322
11:17 20019. available.
Adding access to printer
On client
# lpadmin -p luna -s saturn
Printer server
# lpadmin -p luna -D ”training-lab-ps"
name
# lpadmin -d luna
Makes it default
# lpstat -p luna
printer luna is idle. enabled since Jul 12
11:17 2001. available.
0 to 39
0 top priority
39 lowest priority
Pradip Gudale 343
Managing filters
• Filters are programs that convert one typoe
of file to another
• programs that manage double sided or
landscape printing, draft & letter quality
• detect printer faults and notify print service
• LP print service provides postscript filters
and are loacted/usr/lib/lp/postscript directory.
in
Pradip Gudale 344
filters
• lpfilter command used to manage list of
available filters
• filter descriptors are in /etc/lp/fd
directory.
• Filters themselves are in
/usr/lib/lp.
/etc/lp/filter.table file.
• System information about filters is
stored in
Your chosen name Definition name in /etc/lp/fd
• # lpfilter -f daisytroff -F
Pradip Gudale 345
What do
enable/disable
accept/rejet
do ?
enable/disable : start or stop printing of jobs
that are in queue
SYSTEM SECURITY
Restricted shell
Normal shell
/usr/lib/rsh
/usr/bin/sh
Notice :Not /usr/sbin/rsh (remote shell)
files = 666
directories & executables = 777
Effective permissions
files = 644
directories & executables = 755
Pradip Gudale 376
Display information on files :ls
Text or program
• Type of files d Directory
• Permissions b Block special file
• Number of hard links c Character special file
• Owner of the file p Named pipe (FIFO)
• l Symbolic link
Group of the file
s Socket
• Size of the file, in bytes
• Date the file was created or last date it was changed
• Name of the file
setuid
setgid Octal 6
Stick bit
Pradip Gudale 382
examples
• $ chmod 700 my_prog
• $ ls -l my_prog
rwx 1 mahesh
staff 6023 Jul 5 12:06
my_prog
• $ chmod 755 public_dir
• $ ls -ld public_dir
• drwxrxrx 1 omni staff 6023
Jul 5 12:06 public_dir
Pradip Gudale 383
examples
• $ chmod 4555 dbprog
• $ ls -l dbprog
• rsrxrx 1 db staff 12095
May 6 09:29 dbprog
• $ chmod o-r filea (takes away
read permissions from others)
• $ chmod a+rx fileb (adds r &
x to all)
Pradip Gudale 384
Display in ls -ldb
format Output stored here
# ls l /tmp/filename
sx 1 root rar 45376 Aug 18 15:11
/usr/rar/bin/sh
rsrxrx 1 root bin 12524 Aug 11 01:27
/usr/bin/df
rwsrxrx 1 root sys 21780 Aug 11 01:27
Pradip Gudale 386
/usr/bin/newgrp
ACL
• Salient feature is you can assign
permissions to specific user
e.g. you can give read permission to a
group and read/write permission to a
specific member in that group
• ACL contains entries which are defind
using setfacl
• entry_type:[uid|gid]:perms
Pradip Gudale 387
ACL Entries for files
• /bin/sh
Password agingPradip
infoGudale 395
Finding users
not having passwords
• # logins -p
Disabling logins
temporarily
Create /etc/nologin file with a
message you want to display for
login attempts and reboot the M/C
Pradip Gudale 396
root login is not affected
Saving failed logins
• Create /var/adm/loginlog file with
read/write permissions to root only
• failed login activity will be written to this
file automatically after five failed
attempts.
• user’s login name, tty device, and time
of the failed attempt is recorded.
/dev/term/a
/dev/term/b
Check the presence of
port in this file...
Scheduling Jobs
10 3 * * 0,4 /etc/cron.d/logchecker
10 3 * * 0 /usr/lib/newsyslog (run newsyslog
at 3:10 every Sunday)
15 3 * * 0 /usr/lib/fs/nfs/nfsfind
1 2 * * * [ x /usr/sbin/rtc ] &&
/usr/sbin/rtc c > /dev/null 2>&1
30 3 * * * [ x /usr/lib/gss/gsscred_clean ]
&& /usr/lib/gss/gsscred_clean
Min hours day-of-month month day-of-the-week command
Pradip Gudale 406
/var/spool/cron/crontabs/..
• Crontab file for root and few other users
like adm, lp, sys, uucp exist
• other users can create crontab files and they
are named after their username
e.g. /var/spool/cron/crontabs/mahesh
• you need to be superuser to modify
someone else’s crontab file
/usr/backup/. > /dev/null
Controlling access to crontab
• Accomplished through two files (in
/etc/cron.d ) cron.allow and cron.deny
• allowed users can create, edit, display and
remove crontab files
• By default cron.deny exists but not
cron.allow
• Only superuser can make these files
no
So… to
limit
access to
few users cron.deny exists ?
add their
names to no
allow list.
Don’t Allow only
forget to superuser to work
add root with crontab
there. Allow not Allow
Pradip Gudale listed in this listed412users
to work to work
*Error message for crontab -l
• What do you make out of these ?
crontab: can’t open your
crontab file crontab: you
are not authorized to use
cron. Sorry.
In the first case : crontab file doesnot exist
In the second case: You are denied use of crontab
Pradip Gudale 413
at jobs
$ at 4 am Saturday
at> sort -r /usr/dict/words >
/export/home/anu/big.file
cntrl-d
$ at -l
897543900.a Wed Jul 14 23:45:00 1999
897355800.a Mon Jul 12 19:30:00 1999
897732000.a Sat Jul 17 04:00:00 1999
$ at -r 897732000.a
$ at -l 897732000.a
at: 858142000.a: No such file or
directory