linux7简单应用,在Linux (RHEL/CentOS 7/8 )中,使用6个简单步骤安装AWS CLI

在本文中,我将介绍使用Linux (RHEL/CentOS 7/8 )中的6个简单步骤安装AWS CLI的步骤。

在Linux(RHEL/CentOS 7/8)中安装AWS CLI

步骤1:先决条件

a)你需要有一个正在运行的RHEL/CentOS 7/8系统。

b)你需要在你的系统中安装yum,

c)你应该有sudo访问权限来运行所有权限命令。

步骤2:更新系统

在安装AWS CLI工具之前,建议始终使用最新版本更新系统,因为有时安装软件包需要更新库和其他依赖包,可以通过启动yum update -y命令轻松更新系统,如下所示。[root@localhost ~]# yum update -yLoaded plugins: fastestmirror

Loading mirror speeds from cached hostfile

* base: mirrors.piconets.webwerks.in

* epel: mirror.xeonbd.com

* extras: mirrors.piconets.webwerks.in

* updates: mirrors.piconets.webwerks.in

Resolving Dependencies

--> Running transaction check

---> Package kernel.x86_64 0:3.10.0-1127.10.1.el7 will be installed

---> Package kernel-tools.x86_64 0:3.10.0-1127.8.2.el7 will be updated

---> Package kernel-tools.x86_64 0:3.10.0-1127.10.1.el7 will be an update

---> Package kernel-tools-libs.x86_64 0:3.10.0-1127.8.2.el7 will be updated

---> Package kernel-tools-libs.x86_64 0:3.10.0-1127.10.1.el7 will be an update

---> Package python-perf.x86_64 0:3.10.0-1127.8.2.el7 will be updated

---> Package python-perf.x86_64 0:3.10.0-1127.10.1.el7 will be an update

---> Package unbound-libs.x86_64 0:1.6.6-3.el7 will be updated

---> Package unbound-libs.x86_64 0:1.6.6-4.el7_8 will be an update

--> Finished Dependency Resolution

.....................................................................................................................................................................................................................

步骤3:安装AWS CLI

系统更新后,你就可以用用 yum install awscli -y 命令,如下所示,此命令会自动查找安装AWS CLI所需的所有依赖项,并使用它,[root@localhost ~]# yum install awscli -yLoaded plugins: fastestmirror

Loading mirror speeds from cached hostfile

* base: mirrors.piconets.webwerks.in

* epel: mirror.xeonbd.com

* extras: mirrors.piconets.webwerks.in

* updates: mirrors.piconets.webwerks.in

Resolving Dependencies

--> Running transaction check

---> Package awscli.noarch 0:1.14.28-5.el7_5.1 will be installed

--> Processing Dependency: python-s3transfer >= 0.1.9 for package: install aws cli-1.14.28-5.el7_5.1.noarch

--> Processing Dependency: python-docutils >= 0.10 for package: install aws cli-1.14.28-5.el7_5.1.noarch

--> Processing Dependency: python-cryptography >= 1.7.2 for package: awscli-1.14.28-5.el7_5.1.noarch

--> Processing Dependency: PyYAML >= 3.10 for package: awscli-1.14.28-5.el7_5.1.noarch

--> Running transaction check

---> Package PyYAML.x86_64 0:3.10-11.el7 will be installed

--> Processing Dependency: libyaml-0.so.2()(64bit) for package: PyYAML-3.10-11.el7.x86_64

---> Package python-docutils.noarch 0:0.11-0.3.20130715svn7687.el7 will be installed

--> Processing Dependency: python-imaging for package: python-docutils-0.11-0.3.20130715svn7687.el7.noarch

---> Package python-s3transfer.noarch 0:0.1.13-1.el7.0.1 will be installed

--> Processing Dependency: python-dateutil >= 1.4 for package: python-s3transfer-0.1.13-1.el7.0.1.noarch

---> Package python2-cryptography.x86_64 0:1.7.2-2.el7 will be installed

--> Processing Dependency: python-pyasn1 >= 0.1.8 for package: python2-cryptography-1.7.2-2.el7.x86_64

--> Processing Dependency: python-idna >= 2.0 for package: python2-cryptography-1.7.2-2.el7.x86_64

--> Processing Dependency: python-cffi >= 1.4.1 for package: python2-cryptography-1.7.2-2.el7.x86_64

--> Processing Dependency: python-setuptools for package: python2-cryptography-1.7.2-2.el7.x86_64

--> Processing Dependency: python-enum34 for package: python2-cryptography-1.7.2-2.el7.x86_64

--> Running transaction check

...........................................................................................................................................................................................................

步骤4:检查AWS CLI版本

完成AWS CLI安装后,可以使用aws --version命令检查AWS命令版本,如下所示,如下面的输出所示,aws cli安装的版本为1.14.8。[root@localhost ~]# aws --versionaws-cli/1.14.28 Python/2.7.5 Linux/3.10.0-1127.8.2.el7.x86_64 botocore/1.8.35

步骤5:配置AWS CLI

现在我们可以继续配置AWS命令行来访问AWS资源,可以使用aws configure命令配置它,如下所示,这里你需要提供AWS访问密钥ID,AWS秘密访问密钥和默认区域名称,提供所有详细信息后,您将看到在用户主目录上创建的隐藏目录.aws,其中包含两个文件-Credentials和Config。在配置文件的凭证文件和默认区域中可以找到aws密钥和aws访问密钥。[root@localhost ~]# aws configureAWS Access Key ID [None]: RFIAREPKOP32PU78FSB5

AWS Secret Access Key [None]: Ykloi0EnoZs1sgJOkoSsOesii+utVdiDT+iqsrAw

Default region name [None]: us-east-1

Default output format [None]:

步骤6:测试AWS CLI命令

配置AWS CLI之后,现在可以通过运行一个简单的aws s3 ls命令来列出s$中的所有bucket来测试功能。[root@localhost ~]# aws s3 ls2016-08-21 02:54:27 build

2018-07-17 01:49:26 nets-e3ea7edb7ceuytnc29714b9256e21944

2013-03-27 00:43:52 lates-6uwg866yb53aq

2014-12-08 12:19:17 states-9uwgjkhnk53aq

2015-08-22 13:33:46 plates-7uwg86dfc53aq

2015-03-28 05:40:02 temp-5uwjkh87053aq

2013-09-27 05:08:30 ljt1

2014-02-12 03:09:40 customlogs

2014-04-02 07:43:14 elasticbeanstalk-078365300468

2023-04-29 22:22:24 myfile

2013-09-30 03:40:42 cloudtrail

2017-07-12 09:17:12 pro-logs

2016-10-27 21:45:21 debian-files

2015-03-28 05:51:39 selinux-works

2016-12-13 02:00:50 teccess

2016-03-27 00:41:53 testdrive-cft

2018-11-11 02:18:56 test1

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值