Managing users' SSH access

The only secure server is one that's turned off. Nonetheless, a good approach to access control for servers is to use named user accounts with passphrase-protected SSH keys, rather than having users share an account with a widely-known password. Puppet makes this easy to manage, thanks to the built-in ssh_authorized_key type.

To combine this with virtual users, as described in the previous section, you can create a define, which includes both the user and the ssh_authorized_key. This will also be useful for adding customization files and other per-user resources.

How to do it…

  1. Change the user::virtual class that you created in the section on managing users with virtual resources, to the following:
    class user::virtual { define ...

Get Puppet 2.7 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.