After seeming to succeed in installing the AWS CLI per this page I am getting permission denied errors for basic tests while logged in as root on CentOS release 6.6 running python 2.6.6.

root@hostname [~]# ./awscli-bundle/install -b ~/bin/aws
Running cmd: /usr/bin/python virtualenv.py --python /usr/bin/python /root/.local/lib/aws
Running cmd: /root/.local/lib/aws/bin/pip install --no-index --find-links file:///root/awscli-bundle/packages awscli-1.10.58.tar.gz
You can now run: /root/bin/aws --version
root@hostname [~]# /root/bin/aws --version
-bash: /root/bin/aws: Permission denied
root@hostname [~]# aws help
-bash: /root/bin/aws: Permission denied


 ls -lZ /root/bin/aws
lrwxrwxrwx root root ?                                /root/bin/aws -> /root/.local/lib/aws/bin/aws

I am a developer with very modest sysadmin knowledge and I don't know my next step. I wish to be able to automate the storage of website backup tarballs to my S3 buckets from this server. How do I resolve the permission issues?

UPDATE 2 Per suggestion in comments I managed to enable the EPEL repository and install pip following which I appear to have installed aws as before without error BUT I still get permision denied

root@hostname [~]# yum install epel-release
root@hostname [~]# sudo yum install python-pip
root@hostname [~]# /usr/bin/pip --version
pip 7.1.0 from /usr/lib/python2.6/site-packages (python 2.6)
root@hostname [~]# sudo pip install awscli
[100+ of lines of output]
Successfully installed awscli-1.10.59 botocore-1.4.49 colorama-0.3.7 docutils-0.      12 futures-3.0.5 jmespath-0.9.0 ordereddict-1.1 pyasn1-0.1.9 python-dateutil-2.5      .3 rsa-3.4.2 s3transfer-0.1.2 simplejson-3.3.0 six-1.10.0
root@hostname [~]# which aws
root@hostname [~]# /usr/bin/aws --version
-bash: /usr/bin/aws: Permission denied
root@hostname [~]# /usr/bin/aws help
-bash: /usr/bin/aws: Permission denied
root@hostname [~]# aws --version
-bash: /usr/bin/aws: Permission denied
root@hostname [~]# aws help
-bash: /usr/bin/aws: Permission denied

root@hostname [~]# ls -lZ /usr/bin/aws
-rw-r--r-- root root ?                                /usr/bin/aws
ls -lZ /usr/bin/ > ~/ls.txt
excerpt from ls.txt:
    -rwxr-xr-x  root root    ?                                auvirt*
    lrwxrwxrwx  root root    ?                                awk -> ../../bin/gawk*
    -rw-r--r--  root root    ?                                aws
    -rw-r--r--  root root    ?                                aws_bash_completer
    -rw-r--r--  root root    ?                                aws.cmd
    -rw-r--r--  root root    ?                                aws_completer
    -rw-r--r--  root root    ?                                aws_zsh_completer.sh
    -rwxr-xr-x  root root    ?                                b43-fwcutter*
    -rwxr-xr-x  root root    ?                                base64*
  • Can you edit your question to show what the permissions look like? ls -lZ /root/bin/aws – user4556274 Aug 22 '16 at 19:48
  • @user4556274 added output now – jerrygarciuh Aug 22 '16 at 20:05
  • Try this instead? sudo pip install awscli – dmourati Aug 22 '16 at 20:23
  • @dmourati Do I need to uninstall and start over using sudo? Do I need to not be logged in as root doing that? And which pip gives me nothing so I assume I'll need to install it too, right? – jerrygarciuh Aug 22 '16 at 20:55
  • Looks like you tried using pip in the first attempt. To install it, try sudo yum -y install python-pip. I think you've installed previously under /root/bin. You could simply 'rm aws' there and be fine. – dmourati Aug 22 '16 at 21:27

I don't know why, but all your aws* commands in /usr/bin don't have execution bit set. Why not try chmod +x /usr/bin/aws* and try again?

  • Wow, I feel a little foolish... That's solved it. Thank you. SO says I have to wait 18 hours to award bounty. Will add a task in my list for tomorrow. – jerrygarciuh Aug 25 '16 at 3:02
  • I had to issue this command due to symlinks: chmod +x /usr/local/aws-cli/v2/current/dist/aws2 – flickerfly Jan 16 '20 at 22:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.