|
Softpanorama |
May the source be with you, but remember the KISS principle ;-)
Softpanorama Search
|
There are a few precautions that can be taken to make NIS in Solaris more secure:
The whoami command replies with "no login associated with uid" if the effective UID of its process cannot be found in the password file. Other utilities that check the validity of UIDs are rcp, rlogin, and rsh, all of which generate "can not find password entry for user id" messages if the user's UID cannot be found in the password map.
Any remote user can issue an RPC call to ypserv and retrieve the contents of your NIS maps, provided the remote user knows NIS domainname. To prevent such unauthorized transactions, ypserv supports a feature called securenets which can be used to restrict access to a given set of hosts. At startup, ypserv will attempt to load /var/yp/securenets file that limits access to NIS services. If it exists after loading it, the server only answers queries/supplies maps to hosts and networks whose IP addresses exist in the file. The server must be able to access itself. Therefore the following entry should be present:
host 127.0.0.1
The following example describes a securenets file where:
host 127.0.0.1
255.255.255.0 50.10.1.0
host 50.10.12.1
host 50.10.14.1
After modification of the /var/yp/securenets file, you need to restart the ypserv and ypxfrd daemons:
# /usr/lib/netsvc/yp/ypstop && /usr/lib/netsvc/yp/ypstart
The passwd.adjunct file prevents disclosing the encrypted passwords that
normally form part of the output when viewing the NIS passwd maps to unauthoriaed
users.
Encrypted passwords are normally hidden from the user in the /etc/shadow
file. With the default NIS configuration, however, the encrypted password
string is shown as part of the passwd maps.
The following example shows that if passwd.adjunct file exists, then user passwd is hidden from view when viewing the /etc/passwd file:
# cat /etc/passwd | grep joeuser
joeuser:x:10001:10001::/export/home/joeuser:/bin/ksh
When the ypmatch command runs against the joeuser account value in the passwd map, the following output appears:
# ypmatch -k joeuser passwd
joeuser: joeuser:LojyTdiQev5i2:10001:10001::/export/home/joeuser:/bin/ksh
The encrypted user password is included as part of the NIS passwd maps. To maintain the same security, the system configures the passwd.adjunct file. The passwd.adjunct file contains the account name preceded by ## in the password field. After that the ypcat or ypmatch commands, returns the password entry from the passwd.adjunct file, as follows:
# ypmatch -k joeuser passwd
joeuser:##joeuser:10001:10001::/export/home/joeuser:/bin/ksh
To enable the passwd.adjunct file you need to configure configure C2 security features. See http://sunsolve.sun.com for details.
Copyright © 1996-2009 by Dr. Nikolai Bezroukov. www.softpanorama.org was created as a service to the UN Sustainable Development Networking Programme (SDNP) in the author free time. Submit comments This document is an industrial compilation designed and created exclusively for educational use and is placed under the copyright of the Open Content License(OPL). Site uses AdSense so you need to be aware of Google privacy policy. Original materials copyright belong to respective owners. Quotes are made for educational purposes only in compliance with the fair use doctrine.
Disclaimer:
Last modified: August 10, 2009