Vault:如何减少 ssh otp 的租约期限?

发布于 2025-01-16 22:51:48 字数 503 浏览 1 评论 0原文

我使用以下命令生成一次性密码:

$ vault write ssh/creds/otp_key_role ip=172.31.47.83
Key                Value
---                -----
lease_id           ssh/creds/otp_key_role/TqKAoY2kWLN058cRIzJab5qY
lease_duration     768h
lease_renewable    false
ip                 172.31.47.83
key                ec90e030-f126-ae76-c989-177f33401536
key_type           otp
port               22
username           test-user

otp的lease_duration是768h,我想将lease_duration减少到1h,我该怎么做?

I am use the following comand to generate one time password:

$ vault write ssh/creds/otp_key_role ip=172.31.47.83
Key                Value
---                -----
lease_id           ssh/creds/otp_key_role/TqKAoY2kWLN058cRIzJab5qY
lease_duration     768h
lease_renewable    false
ip                 172.31.47.83
key                ec90e030-f126-ae76-c989-177f33401536
key_type           otp
port               22
username           test-user

the lease_duration of otp is 768h, I want to reduce the lease_duration to 1h, how can I do it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

会傲 2025-01-23 22:51:48

您可以使用以下命令来减少动态密钥的最大租约持续时间。它需要在运行Vault并安装Vault CLI的服务器内部运行

vault secrets tune -max-lease-ttl=60m /pathtosecret

“pathtosecret”应该是您在启用秘密引擎时定义的路径(我认为在您的情况下是ssh)

You can use the following command to reduce the max lease duration for dynamic secrets. It needs to be run inside the server where vault is running and vault CLI is installed

vault secrets tune -max-lease-ttl=60m /pathtosecret

The "pathtosecret" should be the path that you defined while enabling the secret engine (ssh i think in your case)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文