首页 > 解决方案 > AWS CLI version 2 path not found

问题描述

What I am doing:

I am completing the tutorial AWS Basics For Beginners -Full Course. This problem occurs at the 1:19:32 mark. [AWS Basics for Beginners -Full Course][2]

My system:

MacOS Version 10.13.6

Problem:

I can not open the AWS-CLI directory in my command prompt. How can I get to the AWS directory so I can connect my instance?

If I follow these steps from my instance:

  1. Open an SSH client.
  2. Locate your private key file. The key used to launch this instance is xxxxxx.pem
  3. Run this command, if necessary, to ensure your key is not publicly viewable. xxx
  4. Connect to your instance using its Public DNS: xxx

When I run step 3, I get:

chmod: xxxxxxxx.pem: No such file or directory

When I run step 4, I get: -bash: xxxxxxxxxxxxxx.compute-1.amazonaws.com: command not found

What I have done:

I followed the guide [AWS Docs User guide Install CL2][1] and installed through the MacOS interface. I have uninstalled and reinstalled the program. I have been searching Google and Stack Overflow but have not found exactly my problem.

I can confirm my installation was successful by running the following command:

which aws

Which returns:

/usr/local/bin/aws

and

aws --version

which returns:

aws-cli/2.2.41 Python/3.8.8 Darwin/17.7.0 exe/x86_64 prompt/off

However when I enter this command:

cd /usr/local/bin/aws

I get:

-bash: cd: /usr/local/bin/aws: Not a directory

I then use the cd function to change directories one by one:

cd usr

cd local

cd bin

ls

I see:

2to3
idle3
pydoc3.9 2to3-3.9
idle3.9
python3

aws
pip3
python3-config

aws_completer
pip3.9
python3.9 easy_install-3.9
pydoc3
python3.9-config

If I again try:

cd aws

I get:

-bash: cd: aws: Not a directory

Thank you for suggestions and help! [1]: https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2-mac.html#cliv2-mac-remove [2]: https://www.youtube.com/watch?v=ulprqHHWlng

标签: linuxbashamazon-web-servicesamazon-ec2aws-cli

解决方案


/usr/local/bin/aws 是可执行文件的路径。

凭据和密钥存储在 ~/.aws 中。用户根目录中的隐藏目录。


推荐阅读