Let’s take a closer look at the “.aws directory not found” issue in this article. Bobcares, as a part of our AWS Support Services offers solutions to every AWS query that comes our way.
“.aws directory not found.” Why?
The shared AWS
config
Copy Code
and credentials
Copy Code
files are plaintext files that are stored by default in the “home” folder on the computer. On Linux and macOS, this is usually displayed as ~/.aws and the default location of files is ~/.aws/config
Copy Code
~/.aws/credentials
Copy Code
. It is %USERPROFILE%\.aws on Windows and the default location of files is %USERPROFILE%\.aws\config
Copy Code
%USERPROFILE%\.aws\credentials
Copy Code
.

At the start of the path, a ~/ or ~ followed by the file system’s default path separator resolves by checking, in order,
- The
environment variable.HOME
Copy Code - The
environment variable.USERPROFILE
Copy Code - The
environment variable links withHOMEDRIVE
Copy Code
environment variable.HOMEPATH
Copy Code - An SDK or tool-specific home path resolution function or variable.
If a user’s home directory is at the beginning of the path, it resolves to the user name’s home directory whenever possible.
Changing the file’s default location:
In order to change the location or name of these files from the default to a custom value, use the following environment variables.
file environment variable:config
Copy CodeAWS_CONFIG_FILE
Copy Code
file environment variable:credentials
Copy CodeAWS_SHARED_CREDENTIALS_FILE
Copy Code
On Linux or macOS, we can specify an alternate location by running the following export commands.
$ export AWS_CONFIG_FILE=/some/file/path/on/the/system/config-file-name $ export AWS_SHARED_CREDENTIALS_FILE=/some/other/file/path/on/the/system/credentials-file-name
On Windows, we can specify an alternate location by running the following setx commands.
C:\> setx AWS_CONFIG_FILE c:\some\file\path\on\the\system\config-file-name C:\> setx AWS_SHARED_CREDENTIALS_FILE c:\some\other\file\path\on\the\system\credentials-file-name
Folders beginning with . are hidden folders. Users can create them from the command prompt in Windows or Linux by typing mkdir. If we install aws-cli and then run the aws configure command, it result in the creation of this folder in the home folder automatically. When we run the above command, we must supply the default AWS region, AWS access, and secret key on the command prompt. Once we provide that, this creates the following two files in the.aws folder:
config
Copy Code
and credentials
Copy Code
.
The AWS access and secret key will be present in the credentials file. AWS uses this as an authorization mechanism. It is extremely useful when directly accessing AWS resources via command line or creating AWS clients computationally.
To fix “.aws directory not found.” issue:
The .aws folder is in the adminstrator account (user), so keep that in mind while working, because if we don’t have admin power, then login through that and then check for C:UsersAdministrator.aws.
[Looking for a solution to another query? We are just a click away.]
Conclusion
In this article, we provides a simple troubleshooting method from our Support team to the issue, “.aws directory not found.”
PREVENT YOUR SERVER FROM CRASHING!
Never again lose customers to poor server speed! Let us help you.
Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.
var google_conversion_label = "owonCMyG5nEQ0aD71QM";
0 Comments