DOCUMENTATION

Password rotation

Captivo can change the saved password of a Linux, Windows, Active Directory or database account on a schedule or after every session, so that nobody, Captivo included, knows a password that stays valid. This page covers what can be rotated, the privileges each platform needs, what happens on failure and how to take over an account that already exists.

How rotation works

The connector does the work, not the cloud. It generates a random 24-character password with upper case, lower case, digits and a symbol from - _ . ! @ # % + = (no quotes, backslashes, colons or look-alike characters, so it survives every shell and form), changes the account on the target, checks that the new password signs in, and seals it to the key of every connector that serves the resource. The console only stores sealed values it cannot open.

The order is what keeps an account from being locked out: the new password is stored as pending before the target is touched, and it becomes the saved password only once the target has taken it. If the answer never arrives, both passwords are kept and the next attempt asks the target which one it uses. A user keeps connecting through Captivo as before; they never see the password.

Use an account only Captivo signs in with. Any service, scheduled task, script or application that signs in with the account's password stops working after the first rotation.
Password rotation on the resource form: schedule and privileged account.

What can be rotated

ResourceHow the account is changedConnector
SSH (Linux)The account signs in over SSH and runs passwd itself. Reconcile: chpasswd as root or through sudo.2.45.0
RDP, domain accountActive Directory (also Samba AD) over LDAPS or StartTLS: the account deletes its old unicodePwd and adds the new one. Reconcile: the directory's password reset account.2.45.0
RDP, local Windows accountSMB (port 445) with MS-SAMR, the way net user does it remotely. The account changes its own password without any admin right.2.63.0
PostgreSQL, MySQL, MariaDBPostgreSQL gets a SCRAM-SHA-256 verifier made by the connector (ALTER ROLE CURRENT_USER), never the password in clear. MySQL and MariaDB use ALTER USER CURRENT_USER() (MariaDB: SET PASSWORD).2.54.0
SQL ServerA login changes its own password with ALTER LOGIN … OLD_PASSWORD.2.56.0
Redis, MongoDBRedis: ACL SETUSER … resetpass (before Redis 6, CONFIG SET requirepass for the default user). MongoDB: updateUser in the account's own database.2.78.0

Not rotated: SSH keys (only passwords), VNC passwords, credentials that live in your own vault (HashiCorp, CyberArk, Azure Key Vault, AWS Secrets Manager: rotate them there) and SSH-certificate resources, which have no password at all. The rotation panel says which of these applies instead of offering switches. The connector must be online and at least at the version above; the panel shows what it is waiting for otherwise.

Turning it on

Open Infrastructure → Resources, edit the resource and scroll to Password rotation. It appears once the resource has a saved password. You need the console's configure permission (an administrator).

SettingWhat it does
After each sessionOne minute after the last session on the resource ends. While someone is still connected it waits; a quick reconnect inside the minute keeps the password.
On a scheduleOff, 7, 30 or 90 days. Also rotates when nobody used the resource. The API accepts any interval from 1 to 365 days.
Check it dailySigns in once a day with the saved password without changing it. If it no longer works, someone changed it outside Captivo: you are notified, and a reconcile account resets it at once.
Rotate nowRuns one rotation immediately. It refuses while no connector can do it, and waits while a session is open.
Whose accountRDP only: This server (local) or Domain. Read from the user name (NAME or .\NAME is local; DOMAIN\name or name@domain is a domain account); pick one if the guess is wrong.

Press Save rotation after changing the switches. Entering the password again on the resource clears any failure state and pending password. If a person has the password checked out (see credential lifecycle), rotation waits until the check-out ends.

The reconcile account

An account normally changes its own password. That fails in common situations: a minimum password age (Active Directory defaults to one day, so a second change the same day is refused, and after each session hits that quickly), a password history rule, a policy refusal, an expired password, or a saved password someone changed behind your back. The optional reconcile account is a privileged account on the same server that sets the password instead; it bypasses minimum age and history. It is used only for rotation and never for a session.

Add it under Password rotation → Add reconcile account: a user, and for Linux whether it signs in with a Password or an SSH key (keys with a passphrase are not supported). It is sealed in your browser to the connectors, so Captivo cannot read it, and the connector uses it only against this resource's host. For Active Directory the account lives in the directory settings instead (below). It is not mandatory, but without it an out-of-sync or refused account stays failed until a person fixes it.

The sequence per attempt: sign in with the saved password; if it works, self-change; if refused and a reconcile account exists, reset instead; if the saved password does not work and the new one already does, record success; otherwise reset through the reconcile account and flag the account as changed outside Captivo.

Preparing each platform

Hostnames below are examples. The connector must be allowed to reach the target (including any ALLOWED_TARGETS ceiling and the console policy) or it refuses with "target not allowed".

Linux over SSH

The account must be able to sign in over SSH with a password (password or keyboard-interactive/PAM) and run passwd. The user name must be a plain Linux name (letters, digits, . _ -). The first contact pins the server's SSH host key; if it later changes, rotation stops with "the server's SSH host key changed" until you clear the pin with Forget on the resource. For a reconcile account, either use root, or a sudo user. The connector first tests sudo -n true: with passwordless sudo it uses that, with a password account it feeds the password to sudo -S, and a key account needs passwordless sudo.

bash
# On web01.corp.example: a reconcile user that may run anything without a password
sudo useradd -m -s /bin/bash captivo-rot
echo 'captivo-rot ALL=(ALL) NOPASSWD: ALL' | sudo tee /etc/sudoers.d/captivo-rot
sudo chmod 440 /etc/sudoers.d/captivo-rot
sudo visudo -cf /etc/sudoers.d/captivo-rot

# Optional: a minimum password age makes self-change fail; the reconcile account then resets it
sudo chage -l deploy     # shows "Minimum number of days between password change"

A sudoers rule limited to chpasswd alone does not fit the connector's sudo probe; give the reconcile user full passwordless sudo or sign in as root.

Configure the directory first under Identity & access → Directory (see Identity). Password changes need an encrypted connection: set it to LDAPS (port 636) or StartTLS; plain LDAP is refused. If the domain controller's certificate comes from an internal CA, paste that CA in the directory settings. Then, on the same page, use Password reset account → Add reset account with a user such as CORP\svc-captivo-reset. It needs the Reset password right on the users you rotate, not domain admin. The resource's user name must be CORP\alice, alice@corp.example, or a plain name with the resource's domain filled in. The account must be found exactly once under the base DN.

powershell
# Grant the reset account the "Reset password" right on user objects under one OU
dsacls "OU=Servers-Accounts,DC=corp,DC=example" /I:S /G "CORP\svc-captivo-reset:CA;Reset Password;user"

# Check the minimum password age that blocks a second self-change on the same day
Get-ADDefaultDomainPasswordPolicy | Select-Object MinPasswordAge, PasswordHistoryCount

Local Windows accounts

The connector reaches the server on SMB port 445 and uses the samr pipe. The resource's user is Administrator, .\Administrator or WIN-APP01\appsvc, with Whose account = This server. The account may not be disabled, locked or restricted to certain logon hours. The reconcile account must be the built-in Administrator (enabled) or a domain account in the server's local Administrators group: Windows removes the administrator right over the network from every other local administrator (remote UAC), and Captivo reports "no administrator right over the network".

PostgreSQL, MySQL / MariaDB, SQL Server

The connector signs in the way database sessions do, with the resource's TLS setting. With TLS off on MySQL or SQL Server the new password crosses your network readable when the server is told it, and the panel warns you: turn TLS on first. An account changes its own password with no extra privilege; only the optional reconcile account needs the grants below. A MySQL account that exists for several hosts under one name is refused for reset (the connector will not guess which user@host).

sql
-- PostgreSQL (db01.corp.example:5432): may change other roles' passwords
CREATE ROLE captivo_rot LOGIN PASSWORD 'change-me' CREATEROLE;
-- PostgreSQL 16+: CREATEROLE alone only reaches roles you created; grant the target role as well
GRANT app_user TO captivo_rot WITH ADMIN OPTION;

-- MySQL / MariaDB: CREATE USER changes any account; SELECT on mysql.user lets it find the account's host
CREATE USER 'captivo_rot'@'%' IDENTIFIED BY 'change-me';
GRANT CREATE USER ON *.* TO 'captivo_rot'@'%';
GRANT SELECT ON mysql.user TO 'captivo_rot'@'%';

-- SQL Server (server-level permission; run in master)
CREATE LOGIN captivo_rot WITH PASSWORD = 'Ch@nge-me-Now-42';
GRANT ALTER ANY LOGIN TO captivo_rot;

Redis, MongoDB

Redis: the account's own change and the reconcile account both need the +acl permission, for example the default user or a dedicated ACL user. A change lives in memory: with an ACL file the connector also runs ACL SAVE; users defined in redis.conf come back with their old password after a restart. MongoDB: the account must be allowed to change its own password (changeOwnPassword), and the reconcile account signs in to the admin database with the userAdmin role over the account's database. The MongoDB user label is name@database.

javascript
# Redis (cache01.corp.example:6379)
ACL SETUSER captivo-rot on >change-me ~* +acl
ACL SAVE

// MongoDB (mongo01.corp.example:27017), run in the admin database
db.getSiblingDB("admin").createUser({
  user: "captivo-rot", pwd: "change-me",
  roles: [{ role: "userAdmin", db: "orders" }]
})

Sessions and rotation

Session typeRotation
Browser sessions (RDP, SSH, database)Allowed. Captivo signs in with the saved password.
Recorded native SSHAllowed. The jump host ends the user's SSH session and the connector signs in with the saved password.
Recorded native RDPAllowed, for the same reason.
Unrecorded native SSH or RDPNot allowed: the user types the password into their own client, so a password nobody knows is useless. The console refuses to turn rotation on, and refuses to turn the native client on while rotation is on.

Either record the resource (see Recording and monitoring and native RDP and SSH) or leave rotation off. Rotation never runs under an open session: it waits and tries again when that session ends.

Failures and retries

A failed rotation leaves the old password in place and is retried after 5 minutes, then 15 minutes, then 1 hour, then every 6 hours. The panel shows one of these states:

StateMeaning
RotatedThe last change worked. A note says if the reconcile account had to set it.
Last rotation failedThe target refused or could not be reached. The detail names the cause (policy refusal, locked account, host key changed, connector offline).
Being resolvedThe connector could not tell whether the target took the new password (timeouts: connector 24 s, console 29 s). Both passwords are kept; the next attempt finds out.
Changed outside CaptivoThe saved password no longer signs in. With a reconcile account it is reset immediately; without one a person must enter the password again or add the account.

On the first failure of a run Captivo raises a bell notification (Password rotation failed, or Password changed outside Captivo) and a push to the mobile app; retries do not repeat it. A resource waiting for a connector shows why: no connector that holds the password is online, or the connectors that hold it are older than the minimum version.

If Captivo itself is unreachable, read the current password on the host of the connector that last rotated it:

bash
docker exec access-connector connector show-password "db01 · app_user"

Taking over an existing account

Taking over turns an account that already exists on a server into a resource whose password only Captivo knows. On a resource that has a reconcile account (Redis and MongoDB resources always show it), the panel Accounts on this server appears. Press Scan this server: it lists the accounts, who can sign in, who is an administrator, whose password is locked, empty or old. Nothing changes by looking, and password hashes are never sent. Tick up to 20 accounts, confirm I understand and press Take over.

Each picked account becomes a new resource named "<resource> · <user>" with a placeholder password that is due for rotation at once; the first rotation fails the self-change and the reconcile account sets a new random password. From then on the account behaves like any rotated one. The administrator account Captivo signs in with, root, accounts without a shell, the built-in Windows Administrator and Guest, and accounts already managed are refused with the reason shown. On PostgreSQL 16 the administrator must be a superuser or hold ADMIN OPTION on the roles; on Redis and MongoDB, the scan uses the resource's own account and the take-over needs a reconcile account that may change others' passwords. Anything else that used the old password stops working.

Connector versions: 2.72.0 for Linux, 2.75.0 for Windows, 2.76.0 for PostgreSQL and MySQL, 2.77.0 for SQL Server, Redis and MongoDB. Local Windows take-over is not offered for domain accounts.

Audit entries and revealing a password

Everything lands in Audit and in the connector's event history.

EntryWhen
Password rotation settings changedSomeone saved the switches, the reconcile account or Whose account. The entry names who and what.
Password rotatedA rotation succeeded; it says if the reconcile account set it (and which connector did it).
Password rotation failedAn attempt failed or came back unknown, with the reason and the failure count.
Saved password revealedAn administrator opened the password, with the reason.

Reveal password is for emergencies (console access during an outage). It needs a written reason of at least 10 characters unless Policy → Require a reason to reveal a password is turned off; the connector seals the password to a key made in your browser, so only that browser can read it, and if rotation is on the password rotates again two hours later.

Common problems

Message or symptomCause and fix
the directory refused the new password (minimum password age…)AD allows one self-change a day. Add the directory's Password reset account; it bypasses age and history.
passwd refused: …The server's password policy (pam_pwquality, minimum age) rejected it. Add a reconcile account, or relax the minimum age with chage -m 0.
the saved password no longer signs in and there is no reconcile accountSomeone changed it outside Captivo. Enter the password again on the resource, or add a reconcile account.
the server's SSH host key changedThe server was rebuilt or you reach a different machine. If expected, press Forget on the resource's host key.
no administrator right over the networkA Windows reconcile account other than the built-in Administrator (remote UAC). Use Administrator or a domain account in Administrators.
could not reach the server over SMB (port 445)Port 445 is blocked between the connector and the Windows server.
Turning the native client on is refusedRotation is on for an unrecorded resource. Record it or turn rotation off.
Panel says it is waiting for a connectorNo online connector holds the password, or it is older than the minimum version. Update it (connector).
An application broke after the first rotationIt used the account's password. Give it its own account and take that account out of rotation.

Related: Resources, credential lifecycle, database access.

Was this article helpful?