diff --git a/published/20221021.3 ⭐️ How to Install AWS CLI on Linux Step-by-Step.md b/published/20221021.3 ⭐️ How to Install AWS CLI on Linux Step-by-Step.md new file mode 100644 index 0000000000..11c4fca5d1 --- /dev/null +++ b/published/20221021.3 ⭐️ How to Install AWS CLI on Linux Step-by-Step.md @@ -0,0 +1,152 @@ +[#]: subject: "How to Install AWS CLI on Linux Step-by-Step" +[#]: via: "https://www.linuxtechi.com/how-to-install-aws-cli-on-linux/" +[#]: author: "Pradeep Kumar https://www.linuxtechi.com/author/pradeep/" +[#]: collector: "lkxed" +[#]: translator: "littlebirdnest" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15265-1.html" + +如何在 Linux 上安装 AWS 命令行工具 +====== + +![][0] + +> 本文讲述如何一步步在 Linux 上安装 AWS CLI(命令行工具)。 + +AWS CLI 是一个能够和 AWS 账户进行交互的命令行程序。开发者和系统管理员用它管理日常的活动和自动化。 + +### 准备环节 + +- 安装好的 Linux 系统 +- 具有管理员权限的 sudo 账户 +- 能够联网 + +现在让我们开始安装: + +### 1、下载安装文件 + +打开终端使用 `curl` 命令下载 AWS CLI 的安装文件: + +``` +$ curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" +``` + +![][4] + +以上命令会在当前工作目录下载一个 `awscliv2.zip` 的文件。 + +使用 [ls 命令][1] 确认当前下载下来的文件: + +``` +$ ls -l awscliv2.zip +-rw-rw-r-- 1 linuxtechi linuxtechi 47244662 Oct 20 10:53 awscliv2.zip +$ +``` + +### 2、解压缩下载的文件 + +使用 [unzip 命令][2] 解压安装包: + +``` +$ unzip awscliv2.zip +``` + +它会在当前目录创建一个 `aws` 文件夹,把解压好的文件放进去: + +``` +$ ls -ld aws +drwxr-xr-x 3 linuxtechi linuxtechi 4096 Oct 19 17:18 aws +$ +``` + +### 3、运行安装脚本 + +使用以下命令运行安装脚本: + +``` +$ sudo ./aws/install +``` + +![][5] + +脚本会把所有安装的文件放到 `/usr/local/aws-cli` 目录下,然后创建一个链接文件到 `/usr/local/bin` 目录。 + +### 4、检查 AWS CLI 的版本 + +运行以下脚本检查版本: + +``` +$ aws --version +aws-cli/2.8.4 Python/3.9.11 Linux/5.15.0-48-generic exe/x86_64.ubuntu.22 prompt/off +$ +``` + +### 5、配置 AWS CLI + +为了验证 AWS CLI 是否安装正确,开始配置 AWS CLI: + +登录你的 AWS 管理控制台,取得 AWS 访问密钥 IDAccess Key ID安全访问密钥Secret Access Key。 + +如果还没完成创建,请先创建,并把它们复制到安全的地方。 + +![][6] + +然后回到命令行,运行以下命令: + +``` +$ aws configure +AWS Access Key ID [None]: xxxxxxxxxxxxxxxxxxx +AWS Secret Access Key [None]: xxxxxxxxxxxxxxxxxxx +Default region name [None]: us-west-2 +Default output format [None]: json +$ +``` + +以上的证书会被保存到这个文件: + +``` +$ cat  ~/.aws/credentials +``` + +上面的命令的输出: + +![][7] + +运行 `aws` 命令列出你账户中的 s3 储存和 VPC: + +``` +$ aws s3 ls +$ aws ec2 describe-vpcs +``` + +输出如下: + +![][8] + +成功输出内容,说明你的 AWS CLI 已经配置完成。 + +这就是这篇文章的全部内容,请在下面的评论区发表你的疑问和反馈。 + +-------------------------------------------------------------------------------- + +via: https://www.linuxtechi.com/how-to-install-aws-cli-on-linux/ + +作者:[Pradeep Kumar][a] +选题:[lkxed][b] +译者:[littlebirdnest](https://github.com/littlebirdnest) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linuxtechi.com/author/pradeep/ +[b]: https://github.com/lkxed +[1]: https://www.linuxtechi.com/linux-ls-command-examples-beginners/ +[2]: https://www.linuxtechi.com/linux-zip-unzip-command-examples/ +[3]: https://www.linuxtechi.com/how-to-setup-eks-cluster-nlb-on-aws/ +[4]: https://www.linuxtechi.com/wp-content/uploads/2022/10/Download-AWS-CLI-Curl-Command.png +[5]: https://www.linuxtechi.com/wp-content/uploads/2022/10/AWS-CLI-Install-Script-Linux.png +[6]: https://www.linuxtechi.com/wp-content/uploads/2022/10/AWS-Account-Access-Secret-Key.png +[7]: https://www.linuxtechi.com/wp-content/uploads/2022/10/AWS-Configure-Command-Output-Linux.png +[8]: https://www.linuxtechi.com/wp-content/uploads/2022/10/AWS-Command-List-S3-VPC.png +[0]: https://img.linux.net.cn/data/attachment/album/202211/18/112836c2d0bekaxu75ffbx.jpg \ No newline at end of file diff --git a/translated/tech/20221021.3 ⭐️ How to Install AWS CLI on Linux Step-by-Step.md b/translated/tech/20221021.3 ⭐️ How to Install AWS CLI on Linux Step-by-Step.md deleted file mode 100644 index cc8b5a5d40..0000000000 --- a/translated/tech/20221021.3 ⭐️ How to Install AWS CLI on Linux Step-by-Step.md +++ /dev/null @@ -1,130 +0,0 @@ -[#]: subject: "How to Install AWS CLI on Linux Step-by-Step" -[#]: via: "https://www.linuxtechi.com/how-to-install-aws-cli-on-linux/" -[#]: author: "Pradeep Kumar https://www.linuxtechi.com/author/pradeep/" -[#]: collector: "lkxed" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -如何在Linux上安装 AWS CLI -====== - -本文讲述如何一步步Linux上安装 AWS CLI。 AWS CLI是一个能够和aws账户进行交互的命令行程序。开发者和系统管理员用它管理日常的活动和自动化 - -##### 准备环节 - -- 提前安装好Linux系统 -- 有管理员权限 -- 能够联网 - -现在让我们开始安装 - -### 1) 下载安装文件 - -打开终端使用curl命令下载AWS CLI 的安装文件 - -``` -$ curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" -``` - -以上命令会安装一个 ‘awscliv2.zip’的文件在当前工作目录 - -使用ls命令确认当前下载下来的文件 - -``` -$ ls -l awscliv2.zip -rw-rw-r-- 1 linuxtechi linuxtechi 47244662 Oct 20 10:53 awscliv2.zip $ -``` - -### 2) 解压下载的文件 - -使用unzip命令解压安装包 - -if(typeof ez_ad_units != 'undefined'){ez_ad_units.push([[300,250],'linuxtechi_com-medrectangle-3','ezslot_6',320,'0','0'])};__ez_fad_position('div-gpt-ad-linuxtechi_com-medrectangle-3-0'); - -``` -$ unzip awscliv2.zip -``` - -它会在当前目录创建一个aws的文件夹,把解压好的文件放进去 - -``` -$ ls -ld aws drwxr-xr-x 3 linuxtechi linuxtechi 4096 Oct 19 17:18 aws $ -``` - -### 3) 运行安装脚本 - -使用以下命令允许安装脚本 - -``` -$ sudo ./aws/install -``` - -脚本会把所有安装的文件放到 /usr/local/aws-cli目录下,然后创建一个链接文件在/usr/local/bin目录. - -if(typeof ez_ad_units != 'undefined'){ez_ad_units.push([[300,250],'linuxtechi_com-medrectangle-4','ezslot_7',340,'0','0'])};__ez_fad_position('div-gpt-ad-linuxtechi_com-medrectangle-4-0'); - -### 4) 检查AWS CLI的版本 - -运行以下脚本检查版本 - -``` -$ aws --version aws-cli/2.8.4 Python/3.9.11 Linux/5.15.0-48-generic exe/x86_64.ubuntu.22 prompt/off $ -``` - -### 5) 配置 AWS CLI - -安装好AWS CLI,开始配置 AWS CLI - -登录你的AWS管理控制台,取得AWS访问密钥id和访问密钥 - -如果还没完成创建,就创建一个密钥id和密钥,把密钥复制到安全的地方 - -然后回到命令行,运行以下命令 - -if(typeof ez_ad_units != 'undefined'){ez_ad_units.push([[250,250],'linuxtechi_com-box-4','ezslot_8',260,'0','0'])};__ez_fad_position('div-gpt-ad-linuxtechi_com-box-4-0'); - -``` -$ aws configure AWS Access Key ID [None]: xxxxxxxxxxxxxxxxxxx AWS Secret Access Key [None]: xxxxxxxxxxxxxxxxxxx Default region name [None]: us-west-2 Default output format [None]: json $ -``` - -以上的证书会被保存到这个文件 - -``` -$ cat  ~/.aws/credentials -``` - -输出上面的命令 - -运行aws命令,列出你账户中的 s3储存和vpc - -``` -$ aws s3 ls $ aws ec2 describe-vpcs -``` - -输出, - -成功输出内容,说明你的 AWS CLI 已经配置完成 - -以上是全部内容,有问题评论区问 - -if(typeof ez_ad_units != 'undefined'){ez_ad_units.push([[250,250],'linuxtechi_com-banner-1','ezslot_9',360,'0','0'])};__ez_fad_position('div-gpt-ad-linuxtechi_com-banner-1-0'); - -其他文章:[How to Setup EKS Cluster along with NLB on AWS][3] - --------------------------------------------------------------------------------- - -via: https://www.linuxtechi.com/how-to-install-aws-cli-on-linux/ - -作者:[Pradeep Kumar][a] -选题:[lkxed][b] -译者:[littlebirdnest](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.linuxtechi.com/author/pradeep/ -[b]: https://github.com/lkxed -[1]: https://www.linuxtechi.com/linux-ls-command-examples-beginners/ -[2]: https://www.linuxtechi.com/linux-zip-unzip-command-examples/ -[3]: https://www.linuxtechi.com/how-to-setup-eks-cluster-nlb-on-aws/