Select Badges

Select Supported Platforms

Select Status

RSS

m-ssh_users (5) Versions 1.1.0

Mission SSH users - Utility cookbook to ease adding ssh users to systems

Policyfile
Berkshelf
Knife
cookbook 'm-ssh_users', '= 1.1.0', :supermarket
cookbook 'm-ssh_users', '= 1.1.0'
knife supermarket install m-ssh_users
knife supermarket download m-ssh_users
README
Dependencies

Mission SSH Users Cookbook - Create ssh users easily

Example

ssh_user 'millan' do
    pubkey  'ssh-rsa AAAAB3Nz....(truncated)....oSp5lWMutL zmilan@zmilan-ThinkPad-P50'
    groups  ['sudo', 'adm', 'www-data']
    sudo  true
end

Full Syntax

ssh_user 'username' do
    pubkey          String, Array   # accepts a single pubkey in a string or multiple pubkeys in an array.
    groups          String, Array   # accepts a single group in a string or multiple groups in an array
    sudo            True, False     # defaults to false
    home            String          # defaults to "/home/#{username}"
    shell           String          # defaults to "/bin/bash" (overridden if locked is true)
    locked          True, False     # defaults to false
    action          Symbol          # defaults to :create
end

Actions

:create    # Default, creates the account
:remove    # Removes the account from the system (Does not delete home directory)

Properties

groups    One or more groups the user will be added to
home      The user's home directory
locked    If true, the user's shell is set to '/bin/false' to prevent login
shell     The user's login shell
pubkey    Public key that will automatically deploy to the users authorized_keys file
sudo      If true, grants the ability to use sudo (Includes NOPASSWD). If false, removes the ability to use sudo

More Examples

ssh_user 'bob' do
    pubkey  [
      'ssh-rsa AAAAB3Nz....(truncated)....oSp5lWMutL zmilan@zmilan-ThinkPad-P50',
      'ssh-rsa AAAAB3N.....(truncated)....R5pTPlfQ== zmilan@workstation',
    ]
    groups  ['sudo', 'adm', 'www-data']
    sudo  true
end

Dependent cookbooks

This cookbook has no specified dependencies.

Contingent cookbooks

There are no cookbooks that are contingent upon this one.