linux - 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:
- Open an SSH client.
- Locate your private key file. The key used to launch this instance is xxxxxx.pem
- Run this command, if necessary, to ensure your key is not publicly viewable. xxx
- 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
解决方案
/usr/local/bin/aws 是可执行文件的路径。
凭据和密钥存储在 ~/.aws 中。用户根目录中的隐藏目录。
推荐阅读
- bash - 将字符串转换为日期并与文件创建时间进行比较
- html - Bootstrap删除按钮左侧的空间
- python - 跳过前 48 行后用 python 的 Pandas 逐行读取
- java - 如何将 Git 存储库和 Maven 依赖项导入 Eclipse?
- reactjs - 如何使用打字稿在功能组件中使用渲染道具
- linux - 禁用 X11 窗口调整大小但仍接收配置事件
- amazon-web-services - 使用 API Gateway 从 S3 下载已压缩的文件
- bash - tr 用 66 和 99 引号翻译字符问题“”
- javascript - Angular: Does anyone know how to delay a for loop in Angular?
- plot - How do I add a box explaining which line belongs to which function?