1. 安装Putty,将pem转换为ppk (Putty 只支持Private key登陆)
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/putty.html
2. 安装pip
sudo apt install python-pip
完成后检查
pip --version
python --version
python3 -- version
升级pip
pip install --upgrade pip
3. 安装AWS CLI
pip install awscli --upgrade --user
检查版本
aws --version
将AWS CLI加入可执行路径配置
检查文件夹存在
~/.local/bin
查python路径
which python
建立symlink
ls -al /usr/bin/python
具体:
ubuntu@ip-:~$ ~/.local/bin
-bash: /home/ubuntu/.local/bin: Is a directory
ubuntu@ip-:~$ which python
/usr/bin/python
ubuntu@ip-:~$ ls -al /usr/bin/python
lrwxrwxrwx 1 root root 9 Dec 10 2015 /usr/bin/python -> python2.7
查看AWS CLI
aws help
有如下输出表示ok,退出按 q 键
AWS() AWS()
NAME
aws -
DESCRIPTION
The AWS Command Line Interface is a unified tool to manage your AWS
services.
SYNOPSIS
aws [options] <command> <subcommand> [parameters]
Use aws command help for information on a specific command. Use aws
help topics to view a list of available help topics. The synopsis for
each command shows its parameters and their usage. Optional parameters
are shown in square brackets.
4. 配置AWS账户信息
ubuntu@ip-:~$ aws configure
AWS Access Key ID [None]: AAAAAAAAAAAAAAAAAAAAAAA
AWS Secret Access Key [None]: BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
Default region name [None]: us-east-1
Default output format [None]: text
参考文档:
http://docs.aws.amazon.com/cli/latest/userguide/installing.html
http://docs.aws.amazon.com/cli/latest/userguide/awscli-install-linux.html