Linux User
Rotating Linux User Accounts on Local Network

Overview
In this guide, you'll learn how to rotate Linux user accounts within your local network using Keeper Rotation, including both password-based and SSH Key-based credentials. For a high-level overview on the rotation process in the local network, visit this page.
Prerequisites
This guide assumes the following tasks have already taken place:
Keeper Secrets Manager is enabled for your role
Keeper Rotation is enabled for your role
A Keeper Secrets Manager application has been created
1. Set up a PAM Machine Record
Keeper Rotation will use an admin credential to rotate credentials of other accounts in your local environment. These admin credentials need to have the sufficient permissions in order to successfully change the credentials of other accounts.
In this guide, we will store the admin credentials in a PAM Machine Record.
The following table lists all the required fields that needs to be filled on the PAM Machine Record with your information:
Title
Name of the Record ex: "Local Linux Admin"
Hostname or IP Address
Machine hostname or IP as accessed by the Gateway (internal) or "localhost"
Port
22 for SSH
Administrative Credentials
Linked PAM User record that contains the username and password (or SSH Key) of the Admin account which will perform the rotation.
The linked PAM User record with the admin credential needs to be in a shared folder that is accessible to the Keeper Gateway.
2. Set up a PAM Configuration
Note: You can skip this step if you already have a PAM Configuration set up for this environment.
If you are creating a new PAM Configuration, login to the Keeper Vault and select "Secrets Manager", then select the "PAM Configurations" tab, and click on "New Configuration". The following table lists all the required fields on the PAM Configuration Record:
Title
Configuration name, example: Linux LAN Configuration
Environment
Select: Local Network
Gateway
Select the Gateway that is configured on the Keeper Secrets Manager application and has SSH access to your Linux devices
Application Folder
Select the Shared folder where the PAM Configuration will be stored. We recommend placing this in a shared folder with the PAM User records, not the machine resources.
3. Set up one or more PAM User records
Keeper Rotation will use the credentials in the PAM Machine record to rotate the PAM User records on your Local environment. The PAM User credential needs to be in a shared folder that is shared to the KSM application created in the prerequisites.
The following table lists all the required fields on the PAM User record:
Record Type
PAM User
Title
Keeper record title
Login
Case sensitive username of the account being rotated. Example: msmith
Password
Account password is optional, rotation will set one if blank
Private PEM Key
SSH private key. This is only required if you are planning to rotate the PEM key instead of rotating the password.
4. Configure Rotation on the PAM User records
Select the PAM User record(s) from Step 3, edit the record and open the "Password Rotation Settings".
Select the desired schedule and password complexity.
The "Rotation Settings" should use the PAM Configuration setup previously.
The "Resource Credential" field should select the PAM Machine credential setup from Step 1.
Upon saving, the rotation button will be enabled and available to rotate on demand, or via the selected schedule.
Any user with edit
rights to a PAM User record has the ability to setup rotation for that record.
SSH Key Rotation Notes
When rotating the private PEM Key credential on a target machine or user, Keeper will update the authorized_keys file on the machine with the new public key. The first time that a rotation occurs, the old public key is left intact in order to prevent system lockout. The second public key added to the file contains a comment that serves as an identifier for future rotations. For example:
By default, Keeper will not remove other keys from the .ssh/authorized_keys
file since some providers will place in their own keys in order to control the virtual machine (ie Google Cloud Provider).
If the first rotation is successful, you can optionally delete the old public key entry in the authorized_keys file. On subsequent rotations, Keeper will update the line which contains the "keeper-security-xxx" comment.
Rotation will also create backup of the prior .ssh/authorized_keys
inside of the .ssh
directory.
For private key rotation, the new private key will be same algorithm and key size (bits) as the current private key. For example, if the current private key is ecdsa-sha2-nistp256
the new private key will be ecdsa-sha2-nistp256
. This can be overridden by adding a custom text field, with the label Private Key Type
, and setting the value to one support algorithms:
ssh-rsa
- 4096 bitsecdsa-sha2-nistp256
- ECDSA, 256 bitsecdsa-sha2-nistp384
- ECDSA, 384 bitsecdsa-sha2-nistp521
- ECDSA, 521 bitsssh-ed2551
.This custom field can also be used if the current private key's algorithm cannot be detected.
To prevent private key rotation, a custom text field can be added to the PAM User record with the label Private Key Rotate
. If the value of the field is TRUE, or the field doesn't exists, the private key will be rotated if it exists. If the value is FALSE, the private key will not be rotated.
For Linux user rotations, password-encrypted PEM files are not currently supported.
Last updated
Was this helpful?