#Domainname sun.com
#Echo sun.com > /etc/defaultdomain
#Vi /etc/hosts
Sun1 192.168.0.1
Sun2 192.168.0.2 add all the host connected to the network
Wq!
#Cp /etc/nsswitch.nis /etc/nsswitch.conf
#Vi /etc/nsswitch.conf
File nis – add this entry
Wq!
#Cd /var/yp
#Ypinit –m – master server
Enter host 192.168.0.1
Stop at errors say no here
Yes-yes-yes
#Cd /var/yp
#/usr/lib/netsvc/yp/ypstop
#/usr/lib/netsvc/yp/ypstart
Here you can see all the deamon get restarted .
Q)which command display the default nis server
A)ypwhich
Q)which command will display all the master and slave servers
A)Ypcat –k ypservers
Q)how to see the nis users
A)Ypcat passwd
Q)what are the deamons for nis master
A)Ypserv ypbind ypxfrd rpc.ypassword rpc.ypupdates.
Q)what is map
A)Map is table which consist of a key and a file which consist of the information of the key
Q)how to create nis slave server(192.168.0.2)
#Vi /etc/host
Sun1 192.168.0.1 master server ip
Wq!
#Cp /etc/nsswitch.nis /etc/switch.conf
#Vi nsswitch.con
Files nis
Wq!
#Domainname sun.com
#Echo sun.com> /etc/defaultdomain or to maintain more security /var/yp/ypservers
#Cd /var/yp
#Ypinit –s sun1 (master server)
Yes give master server ip or hostname
Error say no
Yes-yes
#Cd /var/up if u r in that directory then its okay
#/usr/lib/netsvc/yp/ypstop
#/usr/lib/netsvc/yp/ypstart
Ypserv ypbind
#Ypwhich – will display master and slave servers
#Ypcat –k ypservers – list master and slave server
Q)what are the daemon for nis slave server
A)Ypserv ypbind
Q)how to see nis user from the slave
A)Ypcat passwd
38)how to configure nis client
#Vi /etc/hosts
Sun1 192.168.0.1 - master
Sun2 192.168.0.2 – slave
Wq!
#Cp /etc/nsswitch.nis /etc/nsswitch.conf
#Domainname sun.com
#Echo sun.com > /etc/defaultdomain or /var/yp/ypservers
#Cd /var/yp
#Ypinit –c
Add the slave if available or master
Yes
No at errors
#Cd /var/yp
#/usr/lib/netsvc/yp/ypstop
#/usr/lib/netsvc/yp/ypstart
Daemons for nis clients are ypbind
Q)To see nis server and master from the client
A)Ypcat –k ypservers
Q)how do you update slave servers from the master
A)Cd /var/yp
#/usr/ccs/bin/make passswd
Or yppush.
Q)how to create nis+ server and client
#Cp /etc/passwd /export/home/nisfiles
#Cp /etc/group /export/home/nisfiles
#Cp /etc/hosts /export/home/nisfiles
#Vi auto_master
Remove all entries and keep only user name home directories
Host1 192.168.0.1:/export/home
Host2 192.168.0.1:/export/home
Wq!
#cp /etc/nsswitch.nis /etc/nsswitch.conf
Files nisplus
Wq!
#domainname sun.com
#echo sun.com>/etc/defaultdomain
#nisserver –r –Y
Reboot
#cd /export/home
#nspopulate -v –F
Q)how to create nis+ client
#cp /etc/nsswitch.nis /etc/nsswitch.conf
Files nisplus
Wq!
#domainname sun.com
#echo sun.com>/etc/defaultdomain
#nisclient –I –h 192.168.0.1 –d sun.com
Listing table & objects in NIS+
• #nisls ;Gives the total objects in NIS+
• #nisls org_dir ;Lists the tables listed in the directory.
Listing a contents of tables
• #niscat passwd.org_dir
Listing table structure
• #niscat -o passwd.org_dir ;lists structure of password table.
Adding A user
• #nistbladm -a name=john uid=123 gid=111 home=/home/john shell=/bin/sh passwd.org_dir
Changing the user information in passwd table (Super user only
Fill in the corresponding values in <>
• #nistbladm –a name=<> passwd=<> uid=<> gid=<> home=<> shelll=<> passwd.org_d
example
• #nistbladm -a name=john uid=123 gid=234 home=/home/john shell=/bin/sh passwd.org_di
to change only shell
• #nistbladm -m shell=/usr/local/bin/bash [name=john],passwd.org_dir
Changing user passwd
As root
• # nispasswd
chkey -p
As user
• $ nispasswd ;update encrypted key
• $chkey -p ;(user NIS+ passwd and login passwd are the same.)
Adding user credentials
• #nisaddcred -p 123 -P john local
• # nisaddcred -p unix.123@planet.com -P john.planet.com. des
123 is userid and john is the user name.
Adding / removing a user dir entry in auto_home table :
• #nistbladm -a key=john value=10.20.30.40:/home/john auto_home.org_dir
• #nistbladm -r key=john auto_home.org_dir ;If key is not unique then more fields needs to be defined .
Removing a user
• #nistbladm -r name=john passwd.org_dir
Modifying the tables for multiple entries.
• #nisaddent -d passwd > /tmp/passwd ;Dump the table to a file
• #vi /tmp/passwd ;Edit the dumped file
• # nisaddent -r -f /etc/passwd passwd ;Put back the dumped file.
nisaddent command is available only for some of the standard tables, for others either nispopulate or nistbladm has to be used .
No comments:
Post a Comment