按照此步骤成功安装 AWS CLI 后页当我以 root 身份登录运行 python 2.6.6 的 CentOS 版本 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
我是一名开发人员,系统管理知识非常有限,我不知道下一步该怎么做。我希望能够自动将网站备份 tarball 从此服务器存储到我的 S3 存储桶中。如何解决权限问题?
更新2 根据评论中的建议,我设法启用了 EPEL 存储库并安装了 pip,之后我似乎像以前一样安装了 aws,没有错误,但我仍然被拒绝许可
root@hostname [~]# yum install epel-release
[succeeded]
root@hostname [~]# sudo yum install python-pip
[succeeded]
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
/usr/bin/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*
答案1
我不知道为什么,但是 /usr/bin 中的所有 aws* 命令都没有设置执行位。为什么不尝试chmod +x /usr/bin/aws*
再试一次?