为什么我的相同" .s3cfg"文件无法在不同的计算机

时间:2015-09-24 11:03:15

标签: amazon-web-services amazon-ec2 aws-cli

我有服务器ec2实例,我收到错误:

$ sh ami-backup.sh 
----------------------------------
   Thu Sep 24 10:37:47 UTC 2015   
----------------------------------
Unable to locate credentials. You can configure credentials by running "aws configure".

同样的脚本在我的本地机器上工作,所以我应对了#34; .s3cfg"到那个服务器仍然会出现同样的错误"无法找到凭据"

在我的本地机器上:

ashish@ashishk:~$ aws ec2 describe-instances --filters Name=vpc-id,Values=vpc-xxx |   awk '{ print $8 }' | sort -n   | grep  "i-" 
i-127fb8df
i-1effb6d3
i-29efe0e4
i-29fd04e4
i-d5888618

在我的服务器(ec2实例)上使用相同的" .s3cfg" :

$ aws ec2 describe-instances --filters Name=vpc-id,Values=vpc-xxx |   awk '{ print $8 }' | sort -n   | grep  "i-" > /tmp/instanceid.txt
Unable to locate credentials. You can configure credentials by running "aws configure".

为什么我的相同" .s3cfg"文件不能在不同的机器上运行!请告诉我这里有什么问题或者如果我复制" .s3cfg"从机器到另一台机器它会工作还是我必须运行" aws configure" &安培;在新机上配置?

1 个答案:

答案 0 :(得分:4)

在您的服务器上,在运行命令之前,使用aws configure设置AWS Access key IDSecret Key ID等内容。

相关问题