简体   繁体   English

使用Java访问AWS Root用户帐户

[英]Access AWS Root User account using java

AWS Root user account details AWS Root用户帐户详细信息

Is there any API by which we can get information of the AWS root user account details? 是否有任何API可以用来获取AWS root用户帐户详细信息的信息?

   ListUsersRequest request = new ListUsersRequest();
   ListUsersResult response = iam.listUsers(request);
   response.getUsers()

The code list all users not the root user account details 该代码列出了所有用户而不是root用户帐户的详细信息

The root user is not an IAM user, so it won't appear in the list of IAM users. 根用户不是IAM用户,因此它不会出现在IAM用户列表中。

If you don't mind me asking, what are you trying to access the root user for? 如果您不介意我问,您要尝试访问root用户的目的是什么?

You can create a set of access keys for the root user and have java connect via those access keys. 您可以为root用户创建一组访问密钥,并通过这些访问密钥来连接java。

Info on how to generate root user access keys can be found here, in the AWS documentation . 有关如何生成root用户访问密钥的信息,请参见AWS文档

Java can be configured to use access credentials as noted here . Java可以被配置为使用访问凭据注意到这里

I must warn you though, it is EXTREMELY bad practice to ever use your root credentials for things like this. 但是,我必须警告您,极端的做法是永远将您的根凭据用于这种情况。 Depending on what you're trying to do, you should ideally aim to use IAM users and roles instead of the root credentials. 根据您要执行的操作,理想情况下,您应该以使用IAM用户和角色而不是根凭据为目标。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用 java api 获取 AWS 帐户详细信息? 不适用于 IAM 用户 - How to get AWS account details using java api? Not for IAM user 使用Java通过同一用户帐户访问多个电子邮件箱 - Access Multiple Email Boxes through Same user Account using Java 使用 java 从 Google 帐户访问最后一个用户位置 - Access last user location from Google account using java JAVA 中用户“root”@“localhost”(使用密码:YES)的访问被拒绝 - Access denied for user 'root'@'localhost' (using password: YES) in JAVA 使用 IAM 用户的访问密钥为第三方 AWS 账户代入角色失败 - Failed to assume role for third-party AWS account using IAM user's access key AWS Lambda:如何使用Java中的IAM角色访问其他账户的存储桶 - AWS Lambda: How to access other account's bucket using IAM Roles in Java Java Spring 中的用户 'root'@'localhost' 的访问被拒绝 - Access denied for user 'root'@'localhost' in Java Spring java.sql.SQLException:在春季使用mysql拒绝用户'root'@'localhost'(使用密码:YES)的访问 - java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES) in spring using mysql 使用适用于Java的AWS开发工具包在AWS Organizations中创建帐户 - Creating Account in the AWS Organizations using AWS SDK for Java 在GAE Java应用程序中使用OAuth2身份验证通过IMAP访问用户GMail帐户 - Access user GMail account via IMAP using OAuth2 authentication in GAE Java application
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM