libnss_sshsock
--------------

libnss_sshsock is an nss library designed to provide nss services over a ssh
master socket.  It currently implements only the passwd and group databases
for lookup.

Implementation:
---------------

The libnss_sshsock library uses the master socket to run the appropriate
getent(1) commands on the remote connection, and then parses the result to
provide to gnu libc's NSS mechanism.  It obtains both the hostname and
socket information from two environment variables:

NSS_SSHSOCK_SOCKET  (path to the master socket)
NSS_SSHSOCK_HOST    (host socket belongs to)

Building:
---------

Untar the nss_sshsock-0.2.tar.gz file.

cd nss_sshsock-0.2
./configure --prefix=/usr
make
sudo make install

Installation:
-------------

The building phase should put the library in /usr/lib.  To use nss_sshsock,
edit your /etc/nsswitch.conf file as follows:

....
passwd:         compat sshsock
group:          compat sshsock
....

Running:
--------

Make sure you, as a user, have esablished a remote ssh master socket, like
so:

ssh -M -S /path/to/socket hostname

then:

setenv NSS_SSHSOCK_SOCKET=/path/to/socket
setenv NSS_SSHSOCK_HOST=hostname

if everything's working alright, you should be able to execute a:

getent passwd

or:

getent group

and see passwd and group entries from the remote system.  If the socket
goes away for some reason, or the environment variables aren't there,
nss_sshsock doesn't do anything.

Modifying:
----------

Currently, nss_sshsock doesn't pull across any user or group id's less
than UIDMIN or GIDMIN, both of which are set to 500.  If for some reason
you need to modify this, change it in nss_sshsock.h, in the src directory.
