Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Creds is a library for managing Linux, FreeBSD and OpenBSD user accounts and credentials.

Project Description

Creds

Creds is a library that simplifies the management of user accounts and their credentials on Linux, FreeBSD and OpenBSD.

Instead of issuing commands to create, update and delete users and their ssh keys, supply Creds with details of the users you want and it will take care of the implementation.

The supported inputs are currently YAML, JSON or python dictionaries.

User vs System accounts

Linux has a default range of user ids to provide to system and user accounts, found in /etc/login.defs.
Creds will attempt to read this file to determine which accounts are in scope for management and, if unavailable, will default to:
UID_MIN = 1000 # User accounts will have an id of 1000 or more
UID_MAX = 60000 # User accounts will not have an id higher than 60000

Example Usage

Read a list of users from users.yml and create them (if missing) or update (if existing):

from creds.users import Users
from creds.plan import (create_plan, execute_plan)

existing_users = Users.from_passwd()  # Get a list of existing users and their keys
proposed_users = Users.from_yaml('users.yml')  # Read the proposed list of users and their keys

# Generate a list of operations to transition from current to existing
plan = create_plan(existing_users=existing_users, proposed_users=proposed_users)
execute_plan(plan=plan)  # Execute the plan

Deleting users

If your input defines all of the user accounts you want to exist, you can choose to purge any that are undefined by adding a parameter to create_plan:

plan = create_plan(existing_users=existing_users, proposed_users=proposed_users,
                   purge_undefined=True)

Protecting users

If there are users you want to protect from change, e.g. you want to make sure that certain users are not deleted or updated under any circumstances, then you can supply a list of usernames for Creds to ignore:

plan = create_plan(existing_users=existing_users, proposed_users=proposed_users,
                   purge_undefined=True, protected_users=['rod', 'jane', 'freddy'])
Release History

Release History

This version
History Node

1.0.15

History Node

1.0.14

History Node

1.0.13

History Node

1.0.12

History Node

1.0.11

History Node

1.0.10

History Node

1.0.9

History Node

1.0.8

History Node

1.0.7

History Node

1.0.6

History Node

1.0.5

History Node

1.0.4

History Node

1.0.3

History Node

1.0.2

History Node

1.0.1

History Node

1.0.0

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
creds-1.0.15.tar.gz (20.4 kB) Copy SHA256 Checksum SHA256 Source May 15, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting