basics



This pages are intended to help Solaris beginners..


Let us start with some basic commands




1 ls | ls –l :To list the files at current location

2 mkdir : To create a directory

3 cd | cd .. : For logging in to a directory

4 df | df –k :To view disk free

5 du :To view disk usage

6 cat > Catenation – :To create a file

7 pwd :To view current location
8 rm | rmdir | rm-r :To remove file and directory
9 cp : To copy a file
10 mv : To move a file and to rename
11 touch : To create a file
12 chmod <>
chmod u+w,g-r,o+w
:To set permission | rwxrwxrwx =777 | owner
group & other | i.e. : r=4 w=2 x=1 by total 7
13 clear : To clear the screen
14 man : To view manual
15 bc :Binary count
16 cal :To view calculator
17 banner : To view banner
18 date :To view date
19 find / -name : To find a specific file
20 grep : To grep a word from a file
21 getent : To search using specific entry in admin file
22 wc : To view word count
23 sort : To sort the content of a file
24 head -<100> : To list only the first <100> lines
25 tail -<100> : To list only the last <100> lines
26 ln hard link – :both file points the i-node
number, link count increases
27 ln –s : for soft link If source is lost entire content is lost, L will
be at the front of filename
28 useradd –m –d| -u –g –G
:To create a user account | u-user id, g-pri.
group, G-sec. group, m-mk dir, d-path

29 passwd : To set password for a user besides there are options that can be used in
conjunction with passwd command for changing all passwd file information

30 usermod |userdel : To modify and to delete a user account

31 groupadd –g To create a new group |-o to reallocated gid
32 /usr/sadm/bin/smuser add -- -n -u -g -d -s/bin/ksh :To create a SM-User
33 /usr/sadm/bin/smuser modify -- -n -N-d -s/bin/ksh :To modify a present user
34 /usr/sadm/bin/smuser delete -- -n :To delete a present user
35 smgroup | :same as above 3 To create, modify and to delete a smgroup
36 smc& To invoke the SMC tool in GUI mode


37 umask :This value will make effect on permission
i.e “/etc/profile” | attains default – restarted
38 vi : To open a file through VI-Editor the more in a seperate post


39 Prtconf :To view system config–memory, peripheral

40 prstat –a :To view the system process status

41 Psrinfo –v : To view information about the processor

42 iostat -En |-xtc 5 : To view the i/o device status
43 Sdtprocess :To view the current system process status
44 sar : To view the system activity in average

45 kill : To kill a process which is listed in prstat
46 Format :To make slices in an hard disk
47 devfsadm –v :To identify the hardware changes

48 devfsadm –C : To invoke cleanup | then only –v fn works
49 newfs /dev/rdsk/c#t#d#s# :To make a new file system on the disk
50 mount /dev/dsk/c#t#d#s# / :To mount the new disk for use

51 Dmesg :To view the diagnostic messages
52 Eeprom : To view the environment messages
53 uname –m | -a :To view the m/c name, version, archi. etc.,
54 /usr/platform/”uname-m”/sbin/prtdiag –v :To view the entire system status includes
memory, cpu, patches, os-version, etc.,

55 pkgadd –d | -s spoolTo install a package | if –s spool is used in
btw_only copies the pkg to spool directory
56 pkgchk : To check for error in a particular package
57 pkginfo : To get info about package in local machine
58 pkgrm : To remove a package from local machine
59 pkginfo |wc –l :To check for number of packages installed


60 fstyp –v /dev/rdsk/ctd#s# :To check for the current “minfree” value
61 tunefs –m # /dev/rdsk/ctds :To set minfree value i.e #% with that of root
62 fsck –o f,p /dev/rdsk/ctds# To run file system check | -o f, p for yes to all
63 fsck –o b=# /dev/rdsk/ctds To restore backup sup. Block|#-sup. Block
64 quot |-af root To view summarized FS ownership
65 mountall To mount all FS which have entry at vfstab
66 mountall –l To mount only the local FS listed in ‘vfstab’
67 umount |/dev/dsk To unmount the mounted file system 1 by 1
68 umount -f ---do--- To unmount forcible | may affect data
69 Umountall To unmount all mounted FS includes N/W
70 umountall –l To unmount all locally mounted FS
71 fuser | -c or –cu To view any process is accessing the FS
72 fuser –ck To kill all process which access the FS


73 Volcheck :To check whether the floppy is ready or not
74 /etc/init.d/volmgt start : To start the volume mgt | to stop, give stop
75 mount –F hsfs –o r0 /dev/dsk/ct#d#s# /cdrom :To mount a cdrom manually
76 mount –F pcfs /dev/diskette/pcfs :To mount a floppy drive manually


77 tar –xvf To uncompress a tar file
78 patchadd | -d To install a patch |–d is for no rollback
79 patchrm To uninstall and rollbacks the patch
80 init 0 To OK prompt
81 init 1 To single user mode
82 init 2 To multi user without network
83 init 3 To console – super user | multiuser with nfs
84 init 5 To shutdown the server
85 init 6 To restart the server
86 init s To single user mode
87 shutdown –y –g <#> -i
To shutdown the system |-y for interactive
mode| # - grace time in seconds
88 Halt To switch over to OK prompt suddenly
89 poweroff | Reboot Alternate command to switch-off & restart
90 who –r To view the current run level
91 who | -a To view all logged-in users in the local sys
92 who –m To view the current user name alone
93 whoami | who I am To view effective user | To view actual user
94 rusers –l To identify all users logged in through n/w
95 finger |-m To view the activity of the users
96 last | To view full details for all users | record
97 last -n 5 reboot To view only the last five reboot activity
98 chown root : sys
/var/adm/loginlog
To activate loginlog entry i.e. to note the
failure login |you must create the directory
99 su | su - To switch into another user | home dir – acti
100 chown filename To change the ownership of a file|-R for dir
101 chmod 1777

Sticky bit permission | user can access dir
102 chmod 4555 Users exe this file will get root privilege
103 chmod 2555 Group exe this file will get root privilege
104 lpadmin –d To config a printer manually | -x to remove
105 lpstat –d To view the systems default printer
106 lp To give an print request
107 reject To stop the queuing printer request
108 disable To stop the printer
109 enable To activate the printer
110 accept To start the queuing printer request
111 /usr/lib/lpsched | lpshut
(or) /etc/init.d/lp start | stop
To start the LP printer service | To stop
the LP printer service
112 lp –d To divert your printing job to a new printer
113 lpstat –a To view the status of the printer
114 lpmove To divert one prt job to another printer
115 at |at> job |ctrl d To assign job at AT schedule| ctrl d to close
116 crontab –e |-r to remove job To assign a job in crontab – it opens a editor
117 at -l & crontab –l To view the AT and crontab content
118 ufsdump 0uf /dev/rmt/0n
/dev/dsk/c#t#d#s#
To perform backup | 0-full backup, uupdate{/
etc/dump dates}, 0-drive or disk
number i.e for incremental, n-no rewind
119 ufsrestore rvf /dev/rmt/0 To restore the backup
120 ufsrestore i /dev/rmt/0 To view the list of files present in the tape
121 mt status |rewind |offline To view the status| To rewind | To eject
122 mt fsf count To move the tape forward count records
123 fssnap –F ufs –o
bs=/var/tmp /export/home
To perform a snapshot backup which
usually stores at /dev/fssnap/0
124 fssnap –i To display a list of snapshot ct avail in sys.
125 prtvtoc /dev/rdsk/ct0ds2 >
/
To store the structure of the given hard disk
to an file through prtvtoc
126 fmthard –s /
/dev/rdsk/ct1ds2
To copy the structure from / and to
make available on the destiny hard disk
Solaris Commands For SA-I & SA-II
4
Vi Editor Commands
S.No Commands Functions
1 vi To open vi editor for a specific file
2 Esc h To move the cursor left - command mode
3 Esc l To move the cursor right - command mode
4 Esc j To move the cursor down - command mode
5 Esc k To move the cursor up - command mode
6 Esc i To Enter into Insertion mode
7 Esc x | 4x To delete a character | deletes 4 character
8 Esc X | 4X To delete left i.e. Back-Space
9 Esc R To over-write a character
10 Esc o To insert a line below the cursor
11 Esc O To insert a line above the cursor
12 Esc u Undo
13 Esc G To move to the last line first character
14 Esc w To move word by word right
15 Esc b To move word by word left
16 Esc H To move to the first line of the current page
17 Esc M To move to the middle of the current page
18 Esc L To move to the last line of current page
19 Esc I To move to the beginning of the line &
append
20 Esc A To move to the end of the line & append
21 Esc dw To delete a word to the right
22 Esc dd To delete the current line completely
23 Esc yy To copy the current line – yanking
24 Esc p To paste the copied content
25 Esc yw To copy a word – cursor must be at the
starting
26 Esc J To join two separate line
27 Esc ~ To change the case i.e. upper to lower & Vvia
28 Esc : wq To save & quit a file – EX-command mode
29 Esc : wq! To save & quit a file forcibly
30 Esc : !sh To go to shell temp. & type Exit to come
back
31 Esc : r! To add the output into the file
32 Esc : r To add the content of into the current
file
33 Esc : q To quit the file without saving
34 Esc : q! To quit the file without saving – forcibly
35 Esc : w To save the file and continue working
36 Esc ZZ To save & quit the file
37 Esc : set nu To assign the number for the lines
38 Esc : set nonu To remove the assigned number for the lines
39 ctrl f Page down
40 ctrl b Page Up



OK Prompt Commands

1 stop a To get into OK prompt
2 stop d For extensive post diagnostics
3 stop n To set default parameter |press until kbd led
flashes
4 boot cdrom To boot from cdrom
5 boot cdrom –s To boot and get into single user mode using
cdrom
6 boot –r To reconfigure |config result will be at
/reconfigure
7 Boot To boot through the default configuration
8 boot disk To boot via specified disk|devalias - entry
must exist
9 boot –s To get into the single user mode
10 boot –a For interactive booting
11 boot –v Detailed device information to the console
12 Help To get command details at OK prompt
13 Printenv To print the environment detail
14 setenv To set environment for a specific parameter
15 reset-all To save the changes and followed by reboot
16 set-defaults To set the values to the manufacturers
setting
17 set-defaults To set the value for a specific parameter
alone
18 probe-scsi | -ide To check for internal scsi/ide status
19 probe-scsi-all |-ide-all To check for internal & external scsi/ide
status
20 probe-fcall-all To check for fiber optics status
21 Devalias To view the alias name & to which its
mapped
22 nvalias To add the alias and its physical address to
the list
23 nvunalias To remove an alias from the current list
24 show-disks To see the physical add of all drives i.e. sec
storage
25 .version To view the version, Ethernet address
details etc.,
26 .speed To view cpu speed, bus speed, etc.,
27 .enet-addr To view only the Ethernet address
28 Showdevs To view all the devices i.e. secondary
storage only
29 Banner To view the ip, mac add, subnet mask etc
30 watch-net To view the status of NIC card
31 watch-net-all To view the status of NIC and network cable


Abbreviation

1 Hme Network Interface Card
2 Qfe Quad Fast Ethernet
3 c0t0d0s0 Controller Target Disk Slice
4 Sparc Scalable Process Architecture
5 UFS Unix File System – for disk mgt
6 HSFS | under ufs High Sierra FS – for SCSI cdrom’s
7 PCFS | under ufs PC-DOS Formatted FS – for floopys
8 NFS | under Distributed FS Network File System – for network
9 TmpFS | under Pseudo FS Temp. FS – for avoid Overhead writing
10 SwapFS | under Pseudo FS Swap FS – for Kernel use
11 FDFS | under Pseudo FS File Descriptor FS – for explicit names
12 Explicit Name It’s the representative of Directory’s
13 ProcFS | under Pseudo FS Process FS –for currently running proc.
14 MntFS | under Pseudo FS Mount FS – for locally mounted FS


Important Locations

1 /etc/profile umask value | profile during login
2 /etc/path_to_inst Physical address mapping - for kernel
3 /usr/bin/dmesg
/usr/sbin/dmesg
Diagnostic message will be here dmesg _shows the content of this files
4 /etc/default/kbd kbd –I _ To initialization above file
Put # before keyboard_abort=disable |this is for preventing stop A in console
5 /var/sadm/install/contents Contains details about installed packages
6 /var/spool/pkg Default location for adding a package
7 /var/sadm/pkg It has the currently installed package
8 /etc/vfstab _ Manual Entry Entries for mounting FS during booting
9 /etc/mnttab _ Auto Entry Entries for currently mounted FS
10 /var/sadm/patch It has the currently installed patches
11 /usr/bin Mostly all commands will be here
12 /var/adm/utmpx Who command reads this location Alone
13 /var/adm/wtmpx last -n command reads this location
14 /var/adm/loginlog _ create it To view the failed login attempts
15 /etc/default/su To view the switching attempts | For this remove
# in console= /dev/console and put #in more /var/adm/sulog
16 /etc/default/login_ edit this file for root logging restrictions |
If PASSREQ=no then null password for root
If #console=/dev/console _ remote root login is allowed,
if no # _ only through single machine,
if console= then root cant be logged anywhere
17 /etc/ftpd/ftpusers Users listed here are not allowed for ftp
18 /var/spool/lp It holds the request and the print Queue
19 / var/lp/logs It holds the history of the printer jobs
20 /etc/lp It has the LP server configuration
21 /etc/hosts _ manual entry contains IP and hostnames of sys. In n/w
22 /etc/cron.d/at.deny|cron.allow To restrict users from using AT & Cron


Hints & Purposes

1 Host Bus Adopter All harddisk will have a common HBA

2 Max 7 Slices Only 7 slices are possible in a hard disk

3 Slice S2 – Back Up Points entire disk – cant be changed or used

4 SUNWCxall Entire Distribution with OEM support 64 bit
5 SUNWCall Entire Distri 64 bit – no 3rd party support
6 SUNWCprog Developer Sys Supp –only manuals & network
7 SUNWCuser End User Sys Supp – limited network support
8 SUNWCreg Core Sys Support – no network


9 Web Installation 1st Installation CD then 1 of 2 CD & 2 of 2 CD
10 JumpStart Installation Installing the OS through network
11 Vi Editor – 3 Modes Command, Insert and Ex-Command Mode
12 OE file system Disk based(ufs), Distributed(nfs) & Pseudo(swap)
13 File Types – 4 types Regular, directories, symbolic link & device files
14 Device naming Logical, physical(actual) & instance(kernal) name
15 Sd n | dad n For scsi | ide n-number – instance name

16 NV Ram – EEPROM Removable chip, inbuilt Lithium battery, host id
17 # before any line in a file This makes that particular line or process inactive


18 Booting of Sun System
Post, generic devi ce drivers, loads config done
by admin, other default parameter, then OS files

19 Backup Superblock It resides at several areas of disk| for restoration

20 Cylinder group – size Default size is 16 cylinders per group

21 Boot block – active for ‘/’ Boot strap program resides here – 15 disk sector

22 Pointer types Direct Pointer and Indirect Pointer
23 “Minfree” Value It’s the space utilized by the operating sys in root

24 Preen During sys boot fsck runs at Non Intractive mode

25 Vol Mgr -/etc/vold.conf Automatically mounts the cdrom and floopy

26 105050-01 patch name 105050 is base code & 01 is the revision number

27 sys wide & user environ While user logs this files get executed by shell
28 Restoresymtable This is a image file of tape formed in hard disk

29 /etc/hosts It is an link to /etc/inet/hosts
30 /opt Common location for utilities and 3rd party tools
31 RSC Remote System Console |consist of serial, n/w mgt port and modem
32 LOM Light Out Management | consists of only serial port and not a part of OS.
33 ALOM Advanced LOM | Consists of serial port and a part of OS and also an
n/w mgt port.
34 SCC System Controller Card | nvram data are stored here its an removable card – resp’ble for booting

35 KVM switch Keyboard Video Mouse switch |common unit
36 Part Number Identity Number 300-4250 |product-exact no/.


Steps Involved In Restoring Root From Tape

ok boot cdrom –s
$ newfs /dev/rdsk/ c0t0d0s0
$ mount /dev/dsk/ c0t0d0s0 /a
$ cd /a
$ ufsrestore rf /dev/rmt/0
$ cd /usr/platform/”uname-m”/lib/fs/ufs
$ installboot bootblk /dev/rdsk/c0t0d0s0
$ umount /a
$ fsck /dev/rdsk/c0t0d0s0


usr/bin -> for all users usr/sbin -> only for root




1 sys-unconfig _ sys restarts To get into the network config. Section
2 ifconfig –a To view ip, mac add, subnet mask,etc status
3 ifconfig hme0 netmask up To assign IP address, netmask and as well
as to make the network up
4 ifconfig hme0 up | down To enable network interface | disable
5 snoop To capture and inspect the network pkgs
6 rpcinfo –p | To list the registered RPC services
7 rpcinfo –d version| pkill-HUP inetd To delete a RPC service registration
| To reactivate your service again
8 etc/init.d/init.wbem status| start | stop To view the status of the SMC service |To
start service | To stop service
9 Smc To open SMC
10 smc edit To open SMC toolbox editor
11 pagesize | default is 8192 b To view the size of memory page
12 /var/sadm/smc/toolboxes/smc/smc.tbx &
/var/sadm/smc/toolboxes/this_computer/this_computer.tbx
Default location for SMC toolbar smc edit command will make effect on this
two files


Introduction To IP - Version IV

/etc/rcS.d/S30network.sh _solaris 8|/etc/rcS.d/S30rootusr.sh _sol 7 & below
During booting of sys these files get exe. This uses ifconfig utility & searches
etc/hostname.xxn to identify instance |xx _ hme/nic

/etc/inet/hosts _ this can be used instead of DNS, NIS, NIS+.
It contains ip,hostname, nickname, comments.

Starting server processes :

To start and stop any event at starting
During the booting of system, the inetd daemon starts few services like NIS, TCP-IP,
DNS, etc. which are not automatically start at boot time. We can view the list of services
that were started by inetd are at /etc/rc2.d/S72inetsvc. Apart from this file the inetd
consults the /etc/inetd.conf to find the service to activate.
In order to stop any event init just put # before the service in the /etc/rc2.d/S72inetsvc
and then execute pkill-HUP inetd command for instant effect.


important files responsible for the network


/etc/nodename Hostname of the server eg: bomexport
/etc/hostname.xxn Hostname of the service or server
/etc/inet/hosts All IP address and hostname of other servers

/etc/net/ticlts/hosts Hostname of the server twice – transport layer independent
/etc/net/ticots/hosts Hostname of the server twice – transport layer independent
/etc/net/ticotsord/hosts Hostname of the server twice – transport layer independent
Either edit these files or else give sys-unconfig in order to configure the network



SWAP Expansion


#swap –s _ to display the virtual swap area
#swap –l _ to display the physical swap area
Adding swap space by slice:
_ create a slice of required size in hard-disk
_ add the entry for that slice in /etc/vfstab for an permanent effect
_ swap –a /dev/dsk/c#t#d#S# | to activate the swap space

Adding swap space by file:
_ #mkfile
_ #swap –a / | to activate the swap file
_ #also add an entry in the /etc/vfstab for an permanent effect
e.g: export/swapfile -- -- swap -- no --

Removing a swap space:

_ #swap –d _ this is to de-activate the swap area
_ remove the entry from the /etc/vfstab
_ delete the slice or file to free the utilized space

Crash Dump

#dumpadm _ its to activate the crash dump device for the fore-coming fault
Procedure to read the crash message:
_ cd /var/crash/”uname-n”/ -> log-into this location
_ mdb unix.# vmcore.# | mdb or adb
when you execute above command the prompt will change as below
> |when prompt is as shown
> ::status
> $c
> $q |to quit the prompt
when there is no prompt type $p>
then you will get the prompt as >

NFS - Network File System

_ Allows the multiple computers to use the same file, to reduce storage cost,
provide data consistency & reliability.
_ NFS daemon starts only when the system enters the run level 3


1 /etc/init.d/nfs.server start | stop To start & stop the NFS service manually
2 share –F nfs –o To share a file for NFS service
3 mount –F nfs : To mount the shared file
4 unshare –F nfs To unshared a file from NFS service
5 shareall -F nfs To share all resources listed in /etc/dfs/dfstab
6 unshareall –F nfs To un-share all resources listed as above
7 dfshares –F nfs To display the currently shared NFS
8 dfmounts -F nfs To display the NFS mounted resources
9 mountall -r -F nfs To mount all remote file resources
10 umountall -r -F nfs To un-mount all remote file resources


1 /etc/dfs/dfstab Local resources that as to share at boot time
2 /etc/dfs/sharetab Currently shared local resources – auto entry
3 /etc/dfs/fstypes Default file-system for remote file system
4 /etc/rmtab FS that remotely mounted by NFS – auto entry
5 /etc/dfs/nfslog.conf NFS logging configuration file
6 /etc/default/nfslogd Configuration files for the nfslogd daemo n



Syslog functions - configuring system messaging


The syslogd daemon and the input from /etc/syslog.conf files work together to facilitate
the syslog messaging for the OE
It can write message to the system log , centralized log host , messaging a user or at
the system console.
For this put the entry in /etc/syslog.conf file. The entries are the type of error [ i.e.
user.err ] and the action field [ i.e. /filename _ the target file, @host _ for specific host,
user _ for specific user, * _ for all logged in users ]

Daemons involved: /etc/rc2.d/S74 syslog
# /etc/init.d/syslog start | stop _ this is to start and stop the daemon.

Auto FS

It provides an automatic mounting using NFS protocol
Its an client side service
Components of auto-mount facility:
Auto FS file system, Auto-mountd daemon, Auto-mount command , Auto FS file system
mount-point is defined in the auto-mount maps on the client system.


Configuring Master Map:
For all types of auto sharing methods the entry must be here. Hence this remains the
base entry for all sharing methods. Edit /etc/auto_master

----------------------entries-------------------
+auto_master # +_ indicates that consider automountd daemon
/home auto_home -browse, (or) -nobrowse

#- browse _ allow the users to view the mount-point
--------------------------------------------------
#automount _ reactivate the above file again
Then shared resources get mounted below the /home/
Direct map entries:
This map is only for general directory’s, and common sharing files (eg: softwares). In
case 1 server is down then it can be get from other. Edit /etc/auto_direct
----------------------entries-------------------
/usr/share/man -ro, soft ser1, ser2, ser3:/usr/share/man
:
#/- auto_direct -ro _ this entry in auto_master
--------------------------------------------------
#automount _ reactivate the above file again
Indirect Map Entries:
This mapping is for user home directories and for their files.
Edit /etc/auto_home
----------------------entries-------------------
magi server_primary:/export/home/babu
:
#/home auto_home -nobrowse _ this entry in auto_master
--------------------------------------------------
procedure:
_ Create the account for the user in both the servers with same UID & GID
_ Put the entry for auto_home as shown above for a desired user e.g. babu
_ # passwd –h babu | in secondary server (/export/home/babu)? /home/magi | change
the home dir as desired
_ # cd /home/magi |in sec server to enter into the pri servers home dir. After all this files
are edited just type #automount -t -v this is to activate the desired mountpoint.
If time is mentioned in –t then upto that time the FS remains mounted when its not in
use.

After all this files are edited just type #automount -t -v this is to activate the
desired mountpoint. If time is mentioned in –t then upto that time the FS remains
mounted when its not in use.


RBAC - Role Based Access Control

This is to assign a specific role for a specific user. For these process four files comes
into picture.
/etc/user_attr
/etc/security/prof_attr
/etc/security/exec_attr
/etc/security/auth_attr

Example: assign a role of shut down , for a specific user
_ #roleadd –u 500 –g 10 –m –d /export/home/role_shut role_shut _
create a role named roleshut
_ vi /etc/security/prof_attr
profile_shut ::: able to shutdown the system_comment: |creating profile
_ # rolemod -P profile_shut , all role_shut |adding profile to the role
_ verify that the role is included in the etc/user_attr
_ #useradd -u 200 -g 10 –m –d /export/home/user_shut –R role_shut
user_shut | this is to create a user and assigning the desired role
_ #passwd user_shut
_ #grep user_shut /etc/user_attr | to check the role attribute for the user
_ #vi /etc/security/exec_attr
profile_shut : suser : cmd : : : /usr/sbin/shutdown : uid=0 |bold area is the location of the
shutdown command this must be searched manually and entered here. | This is to assign
the shutdown command to the profile.
This is how to assign a role for a specific user .
How the user shutdown the system using this role:
_ first login as the user
_ $profiles | this is to list the various RBAC profiles that he associated
_ $role | this is to list the various roles that he associated
_ $su role_shut
_ $/usr/sbin/shutdown –i 5 –g 0 |now the system will go down

Name Server

Name service switching files Location
Local files /etc/nsswitch.files
DNS /etc/nsswitch.dns
NIS /etc/nsswitch.nis
NIS+ /etc/nsswitch.nisplus
LDAP /etc/nsswitch.ldap
DNS & LDAP
DNS and LDAP configuration were similar to NIS only service activation
command and configuration files vary.
#ldapclient _ for ldap client activation |#ldapclient uninit_ un-configure ldap.


NIS

The NIS maps are located at /var/yp/domainname/.byname.pag |& .dir
Similarly /var/yp/domainname/.byaddr.pag |& .dir
Daemons used: ypserv, ypbind, rpc.yppasswdd, ypxfrd, rpc.updated
All five are utilized by server and only first two by clients. Through NIS service a centralized useraccount can be provided.
Configuring a machine as the NIS master server :
_ #cp /etc/nsswitch.nis / etc/nsswitch.conf
_ #domainname accel.com
_ #touch /etc/defaultdomain
_ #domainname > /etc/defaultdomain
_ #cd /etc
_ #touch ethers bootparams locale timezone netgroup netmasks
_ #ypinit -m _ To initialize the master server
_ #/usr/lib/netsvc/yp/ypstart _ To start the NIS daemons
Configuring a machine as the NIS client :
The steps were same as above but instead of ypinit –m give ypinit –c to start client service and also
put the server IP entry in the /etc/hosts.


ACL - Access Control List


It provides greater data access control for each file. Permission for a specific user is also
possible using ACL.
Syntax: setfacl {entry type : UID or GID : permission }
owner [u] user name R,W,X
group [g] group name
other [o] uid/gid
Command Usage
getfacl <> To see the present FACL entry
setfacl –s
setfacl –s u::rwx,g::rw-,o::r--,m:7 file1
To set a permission for existing file |
m_ to set mask value
getfacl file1 | setfacl –f – file2 Copies file permission from f1-f2
setfacl –d u:root:7 file1 To delete an entry from a file
setfacl –m u:root:7 file1 Adding one by one entry in a file
setfacl -r -m u:user:7 file1 rewrites mask in accordance to use r




Comments

Popular Posts