On AIX platform, How to install awscli only to current user? In case non-privileged user, Is it possible for the user to do without sudo privileges?
The answer is big fat YES. It is absolutely possible. The AWS documentation may work well for other distribution. But for AIX, it requires to pass few extra arguments along with pip installer.
The bundle install may not work as expected. I could able to make it with pip installer. These installation procedures must and should executed by login as user whom need awscli.
The installation involves three major steps.
- Install Python (prerequisite)
- Install pip (python installation manager again prerequisite)
- Finally Install awscli and validate
- Login as user who needs awscli exclusively.
- Install python 2.7.9 or above. Note down the python installed location. Use find command to identify.
$find / -name python2.7 –type f $/var/opt/infa/python2.7 –V
The file name may vary depends upon the version of python installed. Ex. python2.6 or python2.7. If you do not found such file simple python (/var/opt/infa/python) should work.
- Install pip.
$mkdir /tmp/installation $cd / tmp/installation $curl -k -O https://bootstrap.pypa.io/get-pip.py $/var/opt/infa/python2.7 get-pip.py
The above command installs pip at the same location where python installed.
- Insatll awscli using pip exclusively to current user. By default it installs at ~/.local directory. You can have your own path by setting PYTHONUSERBASE variable.
$export PYTHONUSERBASE=~/app1 $pip install --user awscli
$~/app1/bin/aws s3 help usage: aws [options] <command> <subcommand> [<subcommand> ...] [parameters] To see help text, you can run: aws help aws <command> help aws <command> <subcommand> help aws: error: argument subcommand: Invalid choice, valid choices are: ls | website cp | mv rm | sync mb | rb presign
Only the current user will able to execute aws cli. Even for root it report module execution error. That is all, So we end up installing awscli exclusively to current user. More over without sudo privileges.
Was it fulfilled your requirement? Please post your comments.