AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 1119939
Accepted
urlator
urlator
Asked: 2023-01-11 10:47:07 +0800 CST2023-01-11 10:47:07 +0800 CST 2023-01-11 10:47:07 +0800 CST

如何删除 aws-vault 中的配置文件

  • 772

我已经习惯于aws-vault add production创建一个临时凭证。因为.aws/credentials中没有生产命名的配置文件,所以我决定删除凭据并配置一个新的,并使用更正的名称。为此,我使用了. 当然,这只会删除凭据,但不会删除命令输出中显示的配置文件名称。有没有办法删除该配置文件名称?aws-vault remove productionaws-vault list

提前致谢。

amazon-web-services
  • 1 1 个回答
  • 86 Views

1 个回答

  • Voted
  1. Best Answer
    larsks
    2023-01-11T14:36:07+08:002023-01-11T14:36:07+08:00

    您在其中看到的配置文件aws-vault list对应于您的文件中定义的配置~/.aws/config文件。要删除配置文件,请编辑~/.aws/config并删除它。例如,如果我看到:

    $ aws-vault list
    Profile                     Credentials                 Sessions                         
    =======                     ===========                 ========                         
    production                  production                  -                                
    testing                     -                           -                               
    

    然后在~/.aws/config我会发现:

    [profile production]
    
    [profile testing]
    

    如果我删除条目[profile testing],我将不再在输出中看到它aws-vault list:

    $ aws-vault list
    Profile                     Credentials                 Sessions                         
    =======                     ===========                 ========                         
    production                  production                  -                                
    

    这是一个完整的演练,以确保我们都看到相同的行为。

    1. 我从一个空的凭据列表开始:

      $ aws-vault list
      Profile                  Credentials              Sessions
      =======                  ===========              ========
      
    2. 我添加production凭据:

      $ aws-vault add production
      Enter Access Key ID: example
      Enter Secret Access Key:
      Added credentials to profile "production" in vault
      

      现在出现在列表中:

      $ aws-vault list
      Profile                  Credentials              Sessions
      =======                  ===========              ========
      production               production               -
      

      这会在以下位置创建一个配置文件条目~/.aws/config:

      $ cat ~/.aws/config
      [profile production]
      
    3. 如果我删除这些凭据:

      $ aws-vault remove production
      Delete credentials for profile "production"? (y|N) y
      Deleted credentials.
      

      即使凭据已被删除,配置文件仍显示在列表中:

      $ aws-vault list
      Profile                  Credentials              Sessions
      =======                  ===========              ========
      production               -                        -
      
    4. 如果我从中删除[profile production]条目~/.aws/config:

      $ sed -i '/profile production/d' ~/.aws/config
      

      然后配置文件不再出现在输出中aws-vault list:

      $ aws-vault list
      Profile                  Credentials              Sessions
      =======                  ===========              ========
      
    • 1

相关问题

  • 网络定价如何在云平台中准确运作?我应该如何避免专门的定价攻击?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve