简体   繁体   中英

Login to AWS from AWS Tools for Powershell

I'm trying to use AWS Tools from Powershell, but I don't know how to log in. So when I run a command I naturally get this error:

No credentials specified or obtained from persisted/shell defaults.

How do I login? I read the article at https://docs.aws.amazon.com/powershell/latest/userguide/specifying-your-aws-credentials.html , but it talks about public and private keys. I don't have those, I login to AWS from the web interface with my username and password (and also a token sent to my phone because I have MFA enabled).

Also, my user isn't allowed to create IAM users (it's a company policy and I can't override it).

If your IAM user account doesn't already have Access and Secret Keys you'll need to create them here.

http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html#Using_CreateAccessKey

Then create a profile

Writes a new (or updates existing) profile with name "myProfileName" in the encrypted SDK store file

Set-AWSCredential -AccessKey akey -SecretKey skey -StoreAs myProfileName

Checks the encrypted SDK credential store for the profile and then falls back to the shared credentials file in the default location

Set-AWSCredential -ProfileName myProfileName

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM