Giter Club home page Giter Club logo

libnss-mapuser's Introduction

libnss_mapuser v1.0.1
Dave Olson <[email protected]>
June 15, 2017

This NSS module has one and only one purpose.  It allows getpwnam() and getpwuid()
lookups for arbitrary usernames, with explict matching to a named account.
The mapped lookup is only done if the requested name is not already present
in /etc/passwd (no other lookup, such as LDAP, is done).

It exists as two separate plugins, because the name lookup should be last
in the passwd database lookup in nsswitch.conf (so any other valid lookup
matches first), while the UID lookup should be first, so that a lookup on
the UID of the mapped user returns the mapped name.

It's intended for use with authentication mechanisms such as RADIUS, where
it is not possible to determine if a username is valid without authenticating
at the same time.

The mapping is done to a single account specified in the configuration
file /etc/nss_mapuser.conf.

The returned passwd field is always filled in as 'x', so that authentication
of the base account is not possible through PAM.  Only the mapped accounts
are able to login, typically through PAM, such as pam_radius.so.

The GECOS field is filled in as 'USERNAME mapped user' and the home directory
uses the same path as the user from /etc/passwd, with the last component replaced
by the passed in username.   The uid, gid, and shell fields are copied directly
from the map_user account passwd dataa.

For example, if the passed in username is 'olsonr', the result of running
   getent -s mapuser passwd olsonr
will be something like this:
   olsonr:x:1017:1017:olsonr mapped user:/home/olsonr:/bin/bash
if the map_user field is set to radius_user, and the radius_user entry in
/etc/passwd is:
   radius_user:x:1017:1017:radius_user,,,:/home/radius_user:/bin/bash

This package will create the radius_user account with adduser if it does not
already exist, and that is the default mapping in the configuration, and will
add the group radius_users with the addgroup command.

The mapping can be changed in the configuration file /etc/nss_mapuser.conf.
In that case, the account must already exist, or should be created with
a command similar to:
   adduser --quiet --firstuid 1000 --disabled-login --ingroup GROUP \
     --gecos "radius user" USERNAME

On install, this package will edit /etc/nsswitch.conf to add the two plugins,
so that it looks similar to:
   passwd:         mapuid compat  mapname
if these plugins are not already present.

libnss-mapuser's People

Contributors

c-po avatar dblouis avatar dplong avatar unicronnl avatar zdc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.