The Vault SSH engine ships with two modes: one-time passwords (OTP) and certificate signing where Vault acts as the SSH CA. The two differ in their network requirements, deployment cost, and revocation strategy.
This article assumes stable behavior as described in the official documentation, and summarizes the design trade-offs, a minimal setup recipe, and the angles most likely to appear on the exam.
The Vault SSH engine centralizes SSH access control to servers. It offers two modes: OTP mode, which issues a single-use password to the user, and CA-signing mode, where Vault acts as the SSH certificate authority and attaches a short-lived certificate to the user's public key.
At the Associate/Ops level, expect questions on which mode to choose under which conditions, the server-side configuration requirements, TTL and revocation thinking, use of audit logs, and rotation operations. OTP requires a PAM helper on each server and talks to Vault at authentication time. CA signing only requires configuring the server to trust the CA public key — no Vault call at authentication time.
In OTP mode, the user obtains a single-use password from Vault and uses it as the SSH password. The server side runs a PAM helper such as vault-ssh-helper, which forwards the received password (OTP) to the Vault API to verify it. The OTP is valid only once and is given a short TTL.
On the Vault side, you enable the SSH engine and create a Role with key_type=otp. The Role accepts constraints such as default_user, allowed_users, cidr_list, port, ttl, and max_ttl. Because you can centrally control the source and destination user, this fits short-lived bastion use cases and phased rollouts well.
In CA-signing mode, Vault holds the signing key as an SSH user CA and issues a certificate — containing the validity period, principals, and so on — for the user's public key. The server trusts Vault's CA public key via TrustedUserCAKeys in sshd_config, and authentication completes purely by verifying the key plus certificate presented at connection time. The server does not need to talk to Vault during authentication.
The Vault-side Role (key_type=ca) controls the signing policy via allowed_users, default_user, ttl/max_ttl, allowed_extensions, default_extensions, allowed_critical_options, and more. Revocation is typically handled through short TTLs and key rotation. Centralized signing dramatically reduces distribution and revocation overhead in large environments.
Connection flow for OTP and CA
OTP is a strong fit when you want to start with lightweight server-side changes, such as a phased rollout or bastion-only use case. By contrast, CA signing significantly cuts operational overhead in environments with many servers or users. It also wins decisively in offline or zero-trust contexts where reaching Vault at authentication time is undesirable.
Exam questions test whether you can justify the choice along four axes: network reachability, server-side requirements, revocation strategy (TTL and rotation), and the differences in what each Role can control.
| Aspect | OTP Mode | CA-Signing Mode | Exam Takeaway |
|---|---|---|---|
| Server-side requirement | Install vault-ssh-helper into PAM and query Vault | Place the CA public key under TrustedUserCAKeys | Be able to name what gets installed and where it goes |
| Network at auth time | Outbound from server to Vault is required | Not needed (client-to-server only) | Reachability decides the mode |
| Client operation | Obtain an OTP and authenticate with a password | Get a signature on the public key and connect with key + certificate | Different vault CLI subpaths (otp vs sign) |
| Revocation / validity | Single-use, short TTL; invalidated the moment it is used | Short TTL by default; central revocation is hard, so rotate keys | Understand the TTL-and-rotation premise |
| Scalability | Helper on every server; depends on Vault availability | Scales nicely via CA public-key distribution and updates | CA wins at scale |
| Typical use case | Bastions, short-term adoption, fine-grained source control | Wide-area distribution for developers and automation; offline authentication | Be able to explain when to use which |
The following is a minimal example for learning and verification. In production, always enable TLS verification, least-privilege policies, and audit logging. Make sshd configuration changes during a maintenance window, and always keep a separate session open to confirm connectivity.
You can run both OTP and CA on the same Vault instance. Separate Roles by purpose and tighten CIDR, user, and TTL constraints.
Step-by-step: Vault configuration, server configuration, and connecting
# 1) Vault 側: SSH エンジンを有効化
vault secrets enable ssh
# 2) OTP モード: Role を作成(例)
vault write ssh/roles/otp-admin \
key_type=otp \
default_user=ubuntu \
allowed_users=ubuntu \
cidr_list=10.0.0.0/24 \
port=22 \
ttl=5m
# 3) サーバ側(OTP): vault-ssh-helper の設定例
# /etc/vault-ssh-helper.d/config.hcl
# vault_addr = "https://vault.example.com:8200"
# tls_skip_verify = false
# tls_ca_cert = "/etc/ssl/certs/vault-ca.pem"
# allowed_roles = "otp-admin"
# PAM 設定例(OpenSSH): /etc/pam.d/sshd に追加
# auth requisite pam_exec.so quiet expose_authtok \
# /usr/local/bin/vault-ssh-helper -config=/etc/vault-ssh-helper.d/config.hcl
# クライアント(OTP): OTP を取得して SSH(パスワード認証)
# Vault にログイン済みとする
auth_output=$(vault ssh -mode=otp -role=otp-admin [email protected])
echo "$auth_output"
# 表示された OTP をパスワードとして入力
# 4) CA 署名モード: 署名鍵を生成
vault write ssh/config/ca generate_signing_key=true
# CA 公開鍵を取得し、サーバへ配布
vault read -field=public_key ssh/config/ca > trusted-user-ca-keys.pem
# Role 作成(CA)
vault write ssh/roles/devops \
key_type=ca \
allow_user_certificates=true \
allowed_users=ubuntu \
default_user=ubuntu \
ttl=30m \
allowed_extensions=permit-pty
# サーバ側(CA): sshd_config の設定
# TrustedUserCAKeys /etc/ssh/trusted-user-ca-keys.pem
# PubkeyAuthentication yes
# (必要に応じて)AuthorizedPrincipalsFile /etc/ssh/auth_principals/%u
# 反映: systemctl reload sshd など
# クライアント(CA): 自分の公開鍵に署名を取得
vault write -field=signed_key ssh/sign/devops \
public_key=@$HOME/.ssh/id_rsa.pub > $HOME/.ssh/id_rsa-cert.pub
# 署名付きで接続(鍵+証明書)
ssh -i $HOME/.ssh/id_rsa -i $HOME/.ssh/id_rsa-cert.pub [email protected]With OTP, logins fail whenever the server cannot reach Vault at authentication time. Make the Vault cluster and network paths redundant in proportion to your availability requirements. CA signing does not require reachability at authentication time, but the discipline that matters most is having a clear CA public-key distribution and rotation procedure (rolling updates plus sshd reload).
Revocation for CA signing assumes short TTLs. Central revocation of individual certificates is hard for typical OpenSSH user certificates, so keep the signing TTL short and rotate the CA key when necessary. Make sure Vault audit logs let you trace who signed which public key and when.
Associate / Ops
問題 1
Internal servers are designed to have no outbound access to external networks and cannot reach Vault at authentication time. Developers can connect to Vault from their own machines. To allow SSH using short-lived certificates, which approach and server-side configuration is correct?
正解: C
When the server cannot reach Vault at authentication time, OTP — which requires online verification — does not fit. With CA signing, the client obtains a short-lived certificate up front, and the server only needs to verify it via TrustedUserCAKeys.
Can an OTP be used multiple times? What happens when it expires?
No. An OTP is single-use and is invalidated the moment it is consumed within the TTL defined on the Role. Once it expires, authentication fails.
What is the impact when Vault goes down?
OTP is affected because it requires a call to Vault at authentication time. CA-signed certificates complete authentication using already-issued short-lived certificates, so logins succeed as long as the certificate is still valid.
How do you rotate the CA key?
Generate a new signing key in Vault (ssh/config/ca) and roll out both the old and new CA public keys to servers in stages. During the transition, accept both keys via TrustedUserCAKeys, and remove the old CA once every client certificate has switched to the new CA.
Practice with certification-focused question sets
無料で問題を解いてみるNicheeLab Editorial Team
NicheeLab editorial team focused on data engineering and cloud certification learning. Content is structured around practical study needs and official exam domains.
Vault Core Concepts: Sealed/Unsealed, Auth, Secrets (2026)
Vault fundamentals — sealed/unsealed state, auth methods, se...
Vault Operations Professional (VOP-003): Complete Guide (2026)
Pass the Vault Operations Professional exam — enterprise pat...
Vault Path-Based Routing: API URL Structure (2026)
How Vault's path-based routing works — mount points, sub-pat...
Vault Tokens: Auth Token Mechanics (2026)
Token fundamentals — service vs. batch tokens, accessor, ren...
Vault Token Types: Service, Batch, Periodic (2026)
Service vs. batch tokens compared — performance, ACL behavio...