Skip to content

agamez/libnss-sqlite3

Repository files navigation

 INSTALLATION
===============

This file explains post compilation steps. It assumes that libnss-sqlite
is compiled and in system libraries directory (/lib).


 1. Create database
--------------------

libnss-sqlite use two SQLite databases to provide authentication services.
Thus the first thing you have to do is to create these DB. Depending on your
sources configuration, you may use one or two DB (--with-passwd-db &
--with-shadow-db switches). Default configuration uses 2 databases:
/etc/passwd.sqlite and /etc/shadow.sqlite, we'll use these here:

cd libnss-sqlite
sudo sqlite3 -init conf/passwd.sql /etc/passwd.sqlite
sudo sqlite3 -init conf/shadow.sql /etc/shadow.sqlite
sudo chmod o-r /etc/shadow.sqlite

That's all, databases are ready. Of course, it's up to you to populate them!
Each database contains a table named 'queries'. Each record inside this table
stores the query that should be performed in order to get the requested
information. Please, refer to conf/passwd.sql and conf/shadow.sql to get an
insight of the queries that can be customized and how to do it.

 2. Configure nsswitch.conf
----------------------------

The second step is to tell glibc that we use this lib. Open /etc/nsswitch.conf
and add sqlite at the end of the passwd, groups and shadow lines. You should
obtain something like :

# ...
passwd:         compat sqlite
group:          compat sqlite
shadow:         compat sqlite
# ...

 3. Test
---------

Insert some records into SQLite db tables, open a new shell (nsswitch.conf is
only read when a new application is launched) and try id [user in SQLite DB].

 4. Limitations
----------------

libnss-sqlite only handle users which are in its DB. You can't have an external
user linked to a DB stored group. This is because additional groups lookup use
username and is quite ugly to implement.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published