{"id":1016,"date":"2018-10-21T00:13:03","date_gmt":"2018-10-21T00:13:03","guid":{"rendered":"https:\/\/www.appservgrid.com\/paw92\/?p=1016"},"modified":"2018-10-23T00:59:40","modified_gmt":"2018-10-23T00:59:40","slug":"how-to-install-and-configure-aws-cli-on-linux","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw92\/index.php\/2018\/10\/21\/how-to-install-and-configure-aws-cli-on-linux\/","title":{"rendered":"how to install and configure aws cli on linux ?"},"content":{"rendered":"<p>AWS Command Line Interface (CLI). Depending on your operating system ways are different for installation. I will show you installation of AWS CLI on Ubuntu and CentOS Linux OS.<\/p>\n<p>Install AWS Command Line Interface ( CLI)<\/p>\n<p><b> Install AWS CLI in Ubuntu Linux<\/b><\/p>\n<p>Pip is recommended method of installing AWS CLI on Linux which is python based tool helps in install, upgrade, and remove Python packages.<\/p>\n<p>\u2013 Install python-pip package using apt-get<\/p>\n<p>[root@linuxforfreshers~] apt-get install python-pip<\/p>\n<p>Install AWS CLI using pip command<\/p>\n<p>[root@linuxforfreshers~] pip install awscli<\/p>\n<p>You can configure it using \u201caws configure\u201d command.<\/p>\n<p>While configuring, it will ask you for the several information like AWS Access Key ID, AWS Secret Access Key, Default region name, Default output format. You need to provide that information. In my case below is the Access Key and Secret Access Key.<\/p>\n<p>AWS Access Key = AKIAJRSF3SHFXWALVL2A<\/p>\n<p>AWS Secret Access Key = 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<\/p>\n<p>Let\u2019s configure it using command.<\/p>\n<p>[root@linuxforfreshers~] aws configure<\/p>\n<p>AWS Access Key ID [None]: AKIAJRSF3SHFXWALVL2A<\/p>\n<p>AWS Secret Access Key [None]: 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<\/p>\n<p>Default region name [None]: us-east-1<\/p>\n<p>Default output format [None]:<\/p>\n<p>Once configuration complete, It will create .aws folder in user\u2019s home directory. Below is the content of .aws directory.<\/p>\n<p>[root@linuxforfreshers~] ls .aws\/<\/p>\n<p>[root@linuxforfreshers~] cat .aws\/config<\/p>\n<p>[root@linuxforfreshers~] cat .aws\/credentials<\/p>\n<p>aws_access_key_id = AKIAJRSF3SHFXWALVL2A<\/p>\n<p>aws_secret_access_key = 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<\/p>\n<p>\u2013 Now Test if AWS CLI is installed correctly or not.<\/p>\n<p>[root@linuxforfreshers~] aws help<\/p>\n<p>If you are given wrong access_key u will get following error.<\/p>\n<p>An error occurred (InvalidAccessKeyId) when calling the ListBuckets operation: The AWS Access Key Id you provided does not exist in our records.<\/p>\n<p>\u2013 Check Version of AWS CLI.<\/p>\n<p>[root@linuxforfreshers]aws &#8211;version<\/p>\n<p>aws-cli\/1.11.129 Python\/2.7.6 Linux\/4.4.0-59-generic botocore\/1.5.92<\/p>\n<p><b>Install AWS CLI in CentOS Linux<\/b><\/p>\n<p>\u2013 Check if python is installed in your system or not. If not install it using below command.<\/p>\n<p>[root@linuxforfreshers~]# yum -y install python<\/p>\n<p>Download the installation script.<\/p>\n<p>[root@linuxforfreshers~]# curl -O https:\/\/bootstrap.pypa.io\/get-pip.py<\/p>\n<p>% Total % Received % Xferd Average Speed Time Time Time Current<\/p>\n<p>Dload Upload Total Spent Left Speed<\/p>\n<p>100 1388k 100 1388k 0 0 205k 0 0:00:06 0:00:06 &#8211;:&#8211;:&#8211; 265k<\/p>\n<p>[root@linuxforfreshers~]#<\/p>\n<p>Run the script with Python.<\/p>\n<p>[root@linuxforfreshers~]# python get-pip.py<\/p>\n<p>Downloading pip-7.0.3-py2.py3-none-any.whl (1.1MB)<\/p>\n<p>100% |\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588| 1.1MB 155kB\/s<\/p>\n<p>Downloading wheel-0.24.0-py2.py3-none-any.whl (63kB)<\/p>\n<p>100% |\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588| 65kB 252kB\/s<\/p>\n<p>Collecting argparse (from wheel)<\/p>\n<p>Downloading argparse-1.3.0-py2.py3-none-any.whl<\/p>\n<p>Installing collected packages: pip, argparse, wheel<\/p>\n<p>Successfully installed argparse-1.3.0 pip-7.0.3 wheel-0.24.0<\/p>\n<p>[root@linuxforfreshers~]#<\/p>\n<p>\u2013 Now install AWS command line using pip.<\/p>\n<p>[root@linuxforfreshers~]# pip install awscli<\/p>\n<p>\u2013 Let\u2019s configure AWS CLI.<\/p>\n<p>[root@linuxforfreshers~] aws configure<\/p>\n<p>AWS Access Key ID [None]: AKIAJRSF3SHFXWALVL2A<\/p>\n<p>AWS Secret Access Key [None]: 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<\/p>\n<p>Default region name [None]: us-east-1<\/p>\n<p>Default output format [None]:<\/p>\n<p>\u2013 Verify either file and folder is created.<\/p>\n<p>[root@linuxforfreshers~] ls .aws\/<\/p>\n<p>[root@linuxforfreshers~] cat .aws\/config<\/p>\n<p>[root@linuxforfreshers~] cat .aws\/credentials<\/p>\n<p>aws_access_key_id = AKIAJRSF3SHFXWALVL2A<\/p>\n<p>aws_secret_access_key = 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<\/p>\n<p>Installation is complete now and you can start using aws cli.<\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/www.linuxforfreshers.com\/2017\/11\/how-to-install-and-configure-aws-cli-on.html\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>AWS Command Line Interface (CLI). Depending on your operating system ways are different for installation. I will show you installation of AWS CLI on Ubuntu and CentOS Linux OS. Install AWS Command Line Interface ( CLI) Install AWS CLI in Ubuntu Linux Pip is recommended method of installing AWS CLI on Linux which is python &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw92\/index.php\/2018\/10\/21\/how-to-install-and-configure-aws-cli-on-linux\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;how to install and configure aws cli on linux ?&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1016","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/1016","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/comments?post=1016"}],"version-history":[{"count":1,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/1016\/revisions"}],"predecessor-version":[{"id":1375,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/1016\/revisions\/1375"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/media?parent=1016"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/categories?post=1016"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/tags?post=1016"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}