s3cmd sync S3 Error: 403 Access Denied - amazon-web-services

I was trying to do
C:\Python27\python s3cmd sync -r K:\a\ s3://test-bucket/test/
on windows. It gives an error
ERROR: S3 error: 403(Access Denied):Access Denied
But the problem is on a different machine with same config for s3cmd, I can push any folder. Only difference is it's linux.
Moreover on earlier machine,
C:\Python27\python s3cmd ls
works fine. Is this a Path problem, then why am I getting access denied? I am logged in as root in both windows (1st machine) and ubuntu(2nd machine).

My bad. I didn't run the command prompt as administrator. I assumed as I was logged in as admin, it does that automatically.
Access Denied was from my end I am assuming for now.

Related

Permission denied (publickey) while signing in to AWS instance

I am using Jenkins to ssh into aws server. I am using .pem file to login to the server. I am using the below command. The server is of the instance type ec2.
+ ssh -o StrictHostKeyChecking=no -i ceyeApp.pem ubuntu#server_ip
but it throws the following error:
+ ssh -o StrictHostKeyChecking=no -i ceyeApp.pem ubuntu#server_ip
Pseudo-terminal will not be allocated because stdin is not a terminal.
Load key "ceyeApp.pem": Permission denied
ubuntu#18.216.231.140: Permission denied (publickey).
Build step 'Execute shell' marked build as failure
It looks like a permissione problem:
Load key "ceyeApp.pem": Permission denied
Is the user using this key able to read it?
Assuming the user is 'foobar' and he is the owener of the key, make sure the key can be read only by him:
chmod 400 ceyeApp.pem
If the problem persists, please issue the command John Rotenstein suggested to have a verbose output of what's happening and figure out what other problem might cause the issue.

s3cmd version 2.1.0 not working with session token

i recently updated s3cmd version to 2.1.0. I want to use Temporary Security Credentials which comes with assume role. This is how my ~/.s3cfg file looks like -
[default]
access_key=XXXXXXXXX
secret_key=XXXXXXXXXXXXXXXXXXXX
access_token=FwoGZXIvYXdzEL3//////////wEaDMk0T+yZCPMSV6H6sCKnAaG4EJ9fc5AlWsZxeZpkBpyuvHmylfbz8Ixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I am getting error :
ERROR: Access to bucket '92xxxxxxx-chef' was denied
ERROR: S3 error: 403 (AccessDenied): Access Denied
while passing keys (access_key, secret_key, access_token) along with command line it's working fine.
~# s3cmd ls s3://928xxxxxxxx-chef/ --access_key=XXXXXXXXXXXX --secret_key=XXXXXXXXXXXXXXXX --
access_token=FwoGZXIvYXdzEL3//////////wEaDMk0T+yZCPMSV6H6sCKnAaG4EJ9fc5AlWsZxeZpkBpyuvHmylfbz8Ie5gRQiHrVFULW4bszAKejZShEXUxZKV0Zqj2J9qY8SlE8Fe6kZ+hgqyJAS4ydfKei4JxSK5xHblRrivKou3yyZgTXzWxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
DIR s3://9281xxxxxxxx-chef/git/
DIR s3://9281xxxxxxxx-chef/xxxxxxx-validator/
2020-08-19 14:19 3601 s3://9281xxxxxxxx-chef/chef_init.rb

Can not access files uploaded to AWS

I am not sure if this post should be posted here on Server Fault site, but I saw some posts about AWS here on Stack Overflow, so I hope this one fits here too.
I got the following problem when zipping and uploading files written in Python and Windows 10 not Ubuntu to AWS lambda function:
[Errno 13] Permission denied
I tried chmod 644 on files before zipping them, but I still have the same issue. All files that I upload to AWS through zipping will have permission denied issue, any solution?
I checked as well other posts about this where they discussed using chmod on files before zipping them, but I got the same problem as well:
Post 1: https://github.com/aws/aws-cli/issues/3235
Post 2: https://forums.aws.amazon.com/thread.jspa?messageID=742422
Post 3: PermissionError: [Errno 13] Permission denied when accessing to aws ec2 accessing-to-aws-ec2
Any suggestions?

Errno 13: Permission denied: 'C:\\Users\\myname\\.aws' when running command: AWS Configure

I have AWS_CONFIG_FILE set to C:\Users\myname\.aws
When I run command aws configure and pass in the correct details I get the below error:
[Errno 13] Permission denied: 'C:\Users\myname.aws'
And a credentials file has appeared in folder C:\Users\myname\.aws
But, when I run the command aws configure again, the AWS Access Key ID and AWS Secret Access Key are already set, but the Default Region Name and Default Output Format are [None].
Question 1:: Why hasn't the config file been created?
Then, when I run command aws s3 ls I get error:
An error occurred (SignatureDoesNotMatch) when calling the ListBuckets operation: The request signature we calculated does not match the signature you provided. Check your key and signing method.
Question 2: Why am I getting this error and how do I fix it?
It worked with me after deleting the credentials inside .aws and trying again. As per the recommendation here.
I tried the other solutions to no avail. The only way to get it to work was to manually create the 2 files required - config with content like this:
[default]
region=ap-southeast-2
output=json
and credentials like this:
[default]
aws_access_key_id=YOURKEY
aws_secret_access_key=YOURSECRETKEY
On Windows the files go into C:\Users\Username\.aws and neither file has an extension. Afterwards you can confirm it with
aws configure list
on the commandline. Hopes this helps someone!

Permission denied. Error code: 3 Error message from server: Permission denied

I am logging into my amazon aws production box using WinSCP and i have successfully setup Tomcat 6. But in webapps folder when i transfer some webservice i get error as:
Permission denied.
Error code: 3
Error message from server: Permission denied
Please help me out to resolve this issue
You haven't mentioned what instance type you are using, but it sounds like you are on some flavor of Linux. You need to chmod or chown the webapps directory so you can place files there, or you can place them elsewhere (like your home directory), then log in and use sudo mv to move it in place.