From 21392bed81b59a60f6d2a5e0ff87b7fc917d3cd9 Mon Sep 17 00:00:00 2001 From: Andy Barrett Date: Tue, 6 Aug 2024 13:13:55 -0600 Subject: [PATCH 01/15] added layout for authentication user guide --- docs/user_guide/authenticate.md | 55 ++++++++++++++++++++++++++++++++- 1 file changed, 54 insertions(+), 1 deletion(-) diff --git a/docs/user_guide/authenticate.md b/docs/user_guide/authenticate.md index ea6ce469..8f971707 100644 --- a/docs/user_guide/authenticate.md +++ b/docs/user_guide/authenticate.md @@ -1,6 +1,10 @@ # Authentication -Introduces the `earthaccess.login` method for managing Earthdata Login and cloud credentials. +You can use `earthaccess` to search for datasets and data without needing to login. However, to access (download or stream) NASA Earth science data, whether from one of the NASA +Distributed Active Archive Centers (DAACs) or from the cloud, you need +an Earthdata Login. You can register for a a free Earthdata Login (EDL) account [here](https://urs.earthdata.nasa.gov/). + +Once you have an Earthdata Login, the `earthaccess.login` method manages Earthdata Login and cloud credentials, when you are working with cloud-hosted data. `earthaccess.login` offers three methods of logging in (or authenticating) using EDL: a manual login method, where you enter EDL username and password manually; and two automatic login methods using EDL credentials stored in a `.netrc` file or in environment variables `EARTHDATA_USERNAME` and `EARTHDATA_PASSWORD`. By default, `earthaccess.login()` will look for a `.netrc` or environment variables first. If neither of these are found, it will prompt you to enter your username and password. The three methods are described in detail below. !!! note "This Page is a Work in Progress" @@ -9,3 +13,52 @@ Introduces the `earthaccess.login` method for managing Earthdata Login and cloud * [Quick start](../quick-start.md) * [How-To Authenticate with earthaccess](../howto/authenticate.md) + + +## Login Manually + +If you have not created a `.netrc` file or `EARTHDATA_USERNAME` and `EARTHDATA_PASSWORD`, you can use the following approach to login. + +``` +>>> import earthaccess + +>>> auth = earthaccess.login() +Enter your Earthdata Login username: your_username +Enter your Earthdata password: +``` + +You don't need to assign the result of `earthaccess.login()` to a variable but doing so enables access session information. These are discussed in [Accessing Session Information](). + +Setting `strategy=interactive` will force a manual login. + +## Login using a `.netrc` + +### Creating a `.netrc` file + +#### Manually creating a `.netrc` file + +[Need Linux, MacOS and Windows option] + +#### Using `earthaccess.login` to create a `.netrc` file + +[Need Linux, MacOS and Windows option] + +## Login using environment variables + +[Need Linux, MacOS and Windows option] + + +## Accessing different endpoints + +### Earthdata User Acceptance Testing (UAT) environment + +If your EDL account is authorized to access the User Acceptance Testing (UAT) system, +you can set earthaccess to work with its EDL and CMR endpoints +by setting the `system` argument at login, as follows: + +```python +import earthaccess + +earthaccess.login(system=earthaccess.UAT) + +``` From f4c7fac4df03fb7dfffcb7011ca88ff80aeef689 Mon Sep 17 00:00:00 2001 From: Andy Barrett Date: Wed, 30 Oct 2024 14:20:04 -0600 Subject: [PATCH 02/15] update authentication and add netrc and env var instructions --- docs/user_guide/authenticate.md | 92 ++++++++++++++++++++++++++++++--- 1 file changed, 86 insertions(+), 6 deletions(-) diff --git a/docs/user_guide/authenticate.md b/docs/user_guide/authenticate.md index 8f971707..f94e5dfc 100644 --- a/docs/user_guide/authenticate.md +++ b/docs/user_guide/authenticate.md @@ -35,17 +35,78 @@ Setting `strategy=interactive` will force a manual login. ### Creating a `.netrc` file -#### Manually creating a `.netrc` file - -[Need Linux, MacOS and Windows option] - #### Using `earthaccess.login` to create a `.netrc` file -[Need Linux, MacOS and Windows option] +You can use `earthaccess.login` to create a `.netrc` for you. +``` +earthaccess.login(persist=True) +``` +You will then be prompted for your Earthdata Login username and password. A `.netrc` (or `_netrc`) file will be created automatically. + +#### Manually creating a `.netrc` file for Earthdata Login Credentials + +=== "MacOS" + Type the following on your command line, replacing `` and `` with your + Earthdata Login credentials. + + ``` + echo "machine urs.earthdata.nasa.gov login password " >> $HOME/.netrc + chmod 600 $HOME/.netrc + ``` + +=== "Linux" + Type the following on your command line, replacing `` and `` with your + Earthdata Login credentials. + + ``` + echo "machine urs.earthdata.nasa.gov login password " >> $HOME/.netrc + chmod 600 $HOME/.netrc + ``` + +=== "Windows" + In a `CMD` session, create a `%HOME%` environment variable. The following line + creates `%HOME%` from the path in `%USERPROFILE%`, which looks something like + `C:\Users\"username"`. + ``` + setx HOME %USERPROFILE% + ``` + You now need to create a `_netrc` file in `%HOME%`. + ``` + echo "machine urs.earthdata.nasa.gov login password " >> %HOME%\_netrc + ``` ## Login using environment variables -[Need Linux, MacOS and Windows option] +Alternatively, Earthdata Login credentials can be created as environment variables EARTHDATA_USERNAME and EARTHDATA_PASSWORD. + +=== "MacOS" + If you want to set the environment variables for the current shell session, type the following on the command line. + ``` + export EARTHDATA_USERNAME="username" + export EARTHDATA_PASSWORD="password" + ``` + If you want to set these environmental variables permanently, add these two lines to your `.profile` file. + + +=== "Linux" + If you want to set the environment variables for the current shell session, type the following on the command line. + ``` + export EARTHDATA_USERNAME="username" + export EARTHDATA_PASSWORD="password" + ``` + If you want to set these environmental variables permanently, add these two lines to your `.bashrc` file. + +=== "Windows" + To set the environment variables for the current `CMD` session, type the following: + ``` + setx EARTHDATA_USERNAME "username" + setx EARTHDATA_PASSWORD "password" + ``` + To set these environmental variables permanantly + 1. Open the start menu. + 2. Search for the "Advanced System Settings" control panel and click on it. + 3. Click on the "Environment Variables" button toward the bottom of the screen. + 4. Follow the prompts to add the variable to the user table. ## Accessing different endpoints @@ -62,3 +123,22 @@ import earthaccess earthaccess.login(system=earthaccess.UAT) ``` + +## Using `earthaccess` to get credentials + +`earthaccess.login` is a very convenient way to manage and provide Earthdata Login credentials. `earthaccess.login` can also be used to obtain S3 credentials to access NASA Earthdata Cloud. If you use `earthaccess` to access data in the cloud, you do not have to use this option, `earthaccess` handles this. However, if you are using other packages, such as `h5coro`, `earthaccess` can save a lot of time. + +``` +import earthaccess +import xarray as xr +import h5coro + +auth = earthaccess.login() +s3_credentials = auth.get_s3_credentials(daac="NSIDC") + +s3url_atl23 = 'nsidc-cumulus-prod-protected/ATLAS/ATL23/001/2023/03/' \ + '01/ATL23_20230401000000_10761801_001_01.h5' +ds = xr.open_dataset(s3url_atl23, engine='h5coro', + group='/mid_latitude/beam_1', + credentials=s3_credentials) +``` \ No newline at end of file From b78e0410f62df84139cbfbb5d4796327a38de187 Mon Sep 17 00:00:00 2001 From: Andy Barrett Date: Wed, 30 Oct 2024 14:32:52 -0600 Subject: [PATCH 03/15] add links --- docs/user_guide/authenticate.md | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/docs/user_guide/authenticate.md b/docs/user_guide/authenticate.md index f94e5dfc..159f7a81 100644 --- a/docs/user_guide/authenticate.md +++ b/docs/user_guide/authenticate.md @@ -1,18 +1,12 @@ # Authentication You can use `earthaccess` to search for datasets and data without needing to login. However, to access (download or stream) NASA Earth science data, whether from one of the NASA -Distributed Active Archive Centers (DAACs) or from the cloud, you need +Distributed Active Archive Centers (DAACs) or from NASA Earthdata Cloud, you need an Earthdata Login. You can register for a a free Earthdata Login (EDL) account [here](https://urs.earthdata.nasa.gov/). -Once you have an Earthdata Login, the `earthaccess.login` method manages Earthdata Login and cloud credentials, when you are working with cloud-hosted data. `earthaccess.login` offers three methods of logging in (or authenticating) using EDL: a manual login method, where you enter EDL username and password manually; and two automatic login methods using EDL credentials stored in a `.netrc` file or in environment variables `EARTHDATA_USERNAME` and `EARTHDATA_PASSWORD`. By default, `earthaccess.login()` will look for a `.netrc` or environment variables first. If neither of these are found, it will prompt you to enter your username and password. The three methods are described in detail below. +Once you have an Earthdata Login, the `earthaccess.login` method manages Earthdata Login, and cloud credentials when you are working with cloud-hosted data. -!!! note "This Page is a Work in Progress" - - We are reorganizing and updating the documentation, so not all pages are complete. If you are looking for information about authenticating using earthaccess see the - How-Tos and Tutorials in links below. - - * [Quick start](../quick-start.md) - * [How-To Authenticate with earthaccess](../howto/authenticate.md) +`earthaccess.login` offers three methods of logging in (or authenticating) using EDL: [a manual login method](#login-manually), where you enter EDL username and password manually; and two automatic login methods using EDL credentials stored in a [`.netrc`](#login-using-a-netrc) file or in [environment variables](#login-using-environment-variables). By default, `earthaccess.login()` will look for a `.netrc` or environment variables first. If neither of these are found, it will prompt you to enter your username and password. The three methods are described in detail below. ## Login Manually From c5f0e9ca5431666888af86121a733e87812d33b6 Mon Sep 17 00:00:00 2001 From: Andy Barrett Date: Wed, 30 Oct 2024 14:36:15 -0600 Subject: [PATCH 04/15] add text to direct to other capabilities --- docs/user_guide/authenticate.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/user_guide/authenticate.md b/docs/user_guide/authenticate.md index 159f7a81..308ea3c9 100644 --- a/docs/user_guide/authenticate.md +++ b/docs/user_guide/authenticate.md @@ -8,6 +8,7 @@ Once you have an Earthdata Login, the `earthaccess.login` method manages Earthda `earthaccess.login` offers three methods of logging in (or authenticating) using EDL: [a manual login method](#login-manually), where you enter EDL username and password manually; and two automatic login methods using EDL credentials stored in a [`.netrc`](#login-using-a-netrc) file or in [environment variables](#login-using-environment-variables). By default, `earthaccess.login()` will look for a `.netrc` or environment variables first. If neither of these are found, it will prompt you to enter your username and password. The three methods are described in detail below. +`earthaccess.login` can also be used to login to [different endpoints](#accessing-different-endpoints) and [get S3 credentials](#using-earthaccess-to-get-credentials). ## Login Manually From b1a1453bdd373bac324cc5a412367e19fada31a5 Mon Sep 17 00:00:00 2001 From: Andy Barrett Date: Tue, 21 Jan 2025 12:12:06 -0700 Subject: [PATCH 05/15] fix conflicts --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c13adeb..39652d71 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,7 @@ and this project uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html) - Auto-add comment to PR that requires maintainer to review and re-run integration tests ([#824](https://github.com/nsidc/earthaccess/issues/824)) ([@chuckwondo](https://github.com/chuckwondo)) +- Add authentication to User Guide documentation. ([#763](https://github.com/nsidc/earthaccess/pull/763)) ([@andypbarrett](https://github.com/andypbarrett)) ### Removed From c06fbfbd3b682785d93bbe8b364dee471f999a24 Mon Sep 17 00:00:00 2001 From: Andy Barrett Date: Mon, 4 Nov 2024 11:24:08 -0700 Subject: [PATCH 06/15] Update docs/user_guide/authenticate.md fix typo - extra "a" Co-authored-by: Matt Fisher <3608264+mfisher87@users.noreply.github.com> --- docs/user_guide/authenticate.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user_guide/authenticate.md b/docs/user_guide/authenticate.md index 308ea3c9..6a946f5f 100644 --- a/docs/user_guide/authenticate.md +++ b/docs/user_guide/authenticate.md @@ -2,7 +2,7 @@ You can use `earthaccess` to search for datasets and data without needing to login. However, to access (download or stream) NASA Earth science data, whether from one of the NASA Distributed Active Archive Centers (DAACs) or from NASA Earthdata Cloud, you need -an Earthdata Login. You can register for a a free Earthdata Login (EDL) account [here](https://urs.earthdata.nasa.gov/). +an Earthdata Login account. You can register for a free Earthdata Login (EDL) account [here](https://urs.earthdata.nasa.gov/). Once you have an Earthdata Login, the `earthaccess.login` method manages Earthdata Login, and cloud credentials when you are working with cloud-hosted data. From 7dd4f69fbb806557db72c5f5c70352f6bdaf0f42 Mon Sep 17 00:00:00 2001 From: Andy Barrett Date: Mon, 4 Nov 2024 11:24:53 -0700 Subject: [PATCH 07/15] Update docs/user_guide/authenticate.md Fix typo - "login" to "log in" Co-authored-by: Matt Fisher <3608264+mfisher87@users.noreply.github.com> --- docs/user_guide/authenticate.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/user_guide/authenticate.md b/docs/user_guide/authenticate.md index 6a946f5f..51086855 100644 --- a/docs/user_guide/authenticate.md +++ b/docs/user_guide/authenticate.md @@ -1,6 +1,7 @@ # Authentication -You can use `earthaccess` to search for datasets and data without needing to login. However, to access (download or stream) NASA Earth science data, whether from one of the NASA +You can use `earthaccess` to search for datasets and data without needing to log in. +However, to access (download or stream) NASA Earth science data, whether from one of the NASA Distributed Active Archive Centers (DAACs) or from NASA Earthdata Cloud, you need an Earthdata Login account. You can register for a free Earthdata Login (EDL) account [here](https://urs.earthdata.nasa.gov/). From 138c123726aa75ee2e09e177d65d02593dde9e9d Mon Sep 17 00:00:00 2001 From: Andy Barrett Date: Mon, 4 Nov 2024 11:25:24 -0700 Subject: [PATCH 08/15] Update docs/user_guide/authenticate.md Co-authored-by: Matt Fisher <3608264+mfisher87@users.noreply.github.com> --- docs/user_guide/authenticate.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user_guide/authenticate.md b/docs/user_guide/authenticate.md index 51086855..d3b06595 100644 --- a/docs/user_guide/authenticate.md +++ b/docs/user_guide/authenticate.md @@ -5,7 +5,7 @@ However, to access (download or stream) NASA Earth science data, whether from on Distributed Active Archive Centers (DAACs) or from NASA Earthdata Cloud, you need an Earthdata Login account. You can register for a free Earthdata Login (EDL) account [here](https://urs.earthdata.nasa.gov/). -Once you have an Earthdata Login, the `earthaccess.login` method manages Earthdata Login, and cloud credentials when you are working with cloud-hosted data. +Once you have an Earthdata Login account, you may use the `earthaccess.login` method to manage Earthdata Login credentials and, when you are working with cloud-hosted data, cloud credentials. `earthaccess.login` offers three methods of logging in (or authenticating) using EDL: [a manual login method](#login-manually), where you enter EDL username and password manually; and two automatic login methods using EDL credentials stored in a [`.netrc`](#login-using-a-netrc) file or in [environment variables](#login-using-environment-variables). By default, `earthaccess.login()` will look for a `.netrc` or environment variables first. If neither of these are found, it will prompt you to enter your username and password. The three methods are described in detail below. From a6f27d180ea36bc6b96e94fc93b4fd7d6c31dac3 Mon Sep 17 00:00:00 2001 From: Andy Barrett Date: Mon, 4 Nov 2024 12:24:04 -0700 Subject: [PATCH 09/15] Update docs/user_guide/authenticate.md make method summary a bulleted list with links Co-authored-by: Matt Fisher <3608264+mfisher87@users.noreply.github.com> --- docs/user_guide/authenticate.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/user_guide/authenticate.md b/docs/user_guide/authenticate.md index d3b06595..e391a9e0 100644 --- a/docs/user_guide/authenticate.md +++ b/docs/user_guide/authenticate.md @@ -7,7 +7,13 @@ an Earthdata Login account. You can register for a free Earthdata Login (EDL) a Once you have an Earthdata Login account, you may use the `earthaccess.login` method to manage Earthdata Login credentials and, when you are working with cloud-hosted data, cloud credentials. -`earthaccess.login` offers three methods of logging in (or authenticating) using EDL: [a manual login method](#login-manually), where you enter EDL username and password manually; and two automatic login methods using EDL credentials stored in a [`.netrc`](#login-using-a-netrc) file or in [environment variables](#login-using-environment-variables). By default, `earthaccess.login()` will look for a `.netrc` or environment variables first. If neither of these are found, it will prompt you to enter your username and password. The three methods are described in detail below. +`earthaccess.login` offers three methods of logging in (or authenticating) using EDL: + +* [a manual login method](#login-manually), where you enter EDL username and password manually +* an automatic login method using EDL credentials stored in a [`.netrc`](#login-using-a-netrc) file +* an automatic login method using EDL credentials stored in [environment variables](#login-using-environment-variables). + +By default, `earthaccess.login()` will look for a `.netrc` or environment variables first. If neither of these are found, it will prompt you to enter your username and password. The three methods are described in detail below. `earthaccess.login` can also be used to login to [different endpoints](#accessing-different-endpoints) and [get S3 credentials](#using-earthaccess-to-get-credentials). From ffc66f311db1cb4153244dc01b4e7fca61c262e6 Mon Sep 17 00:00:00 2001 From: Andy Barrett Date: Mon, 4 Nov 2024 12:25:10 -0700 Subject: [PATCH 10/15] Update docs/user_guide/authenticate.md add explanatory text Co-authored-by: Matt Fisher <3608264+mfisher87@users.noreply.github.com> --- docs/user_guide/authenticate.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user_guide/authenticate.md b/docs/user_guide/authenticate.md index e391a9e0..6a938399 100644 --- a/docs/user_guide/authenticate.md +++ b/docs/user_guide/authenticate.md @@ -19,7 +19,7 @@ By default, `earthaccess.login()` will look for a `.netrc` or environment variab ## Login Manually -If you have not created a `.netrc` file or `EARTHDATA_USERNAME` and `EARTHDATA_PASSWORD`, you can use the following approach to login. +If you have not created a `.netrc` file or `EARTHDATA_USERNAME` and `EARTHDATA_PASSWORD` environment variables, you can use the following approach to login. ``` >>> import earthaccess From 9bf70a5f965679eff6790acf3c2a05f9513ff7b5 Mon Sep 17 00:00:00 2001 From: Andy Barrett Date: Mon, 4 Nov 2024 12:27:04 -0700 Subject: [PATCH 11/15] Update docs/user_guide/authenticate.md Change to fixed-width Co-authored-by: Matt Fisher <3608264+mfisher87@users.noreply.github.com> --- docs/user_guide/authenticate.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user_guide/authenticate.md b/docs/user_guide/authenticate.md index 6a938399..027d2ec0 100644 --- a/docs/user_guide/authenticate.md +++ b/docs/user_guide/authenticate.md @@ -79,7 +79,7 @@ You will then be prompted for your Earthdata Login username and password. A `.n ## Login using environment variables -Alternatively, Earthdata Login credentials can be created as environment variables EARTHDATA_USERNAME and EARTHDATA_PASSWORD. +Alternatively, Earthdata Login credentials can be created as environment variables `EARTHDATA_USERNAME` and `EARTHDATA_PASSWORD`. === "MacOS" If you want to set the environment variables for the current shell session, type the following on the command line. From 205e3bf2f835bb7db16a8c92500a698382ed1dde Mon Sep 17 00:00:00 2001 From: Andy Barrett Date: Mon, 4 Nov 2024 12:30:12 -0700 Subject: [PATCH 12/15] Update docs/user_guide/authenticate.md Make terminology consistent Co-authored-by: Matt Fisher <3608264+mfisher87@users.noreply.github.com> --- docs/user_guide/authenticate.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user_guide/authenticate.md b/docs/user_guide/authenticate.md index 027d2ec0..7303b61f 100644 --- a/docs/user_guide/authenticate.md +++ b/docs/user_guide/authenticate.md @@ -113,7 +113,7 @@ Alternatively, Earthdata Login credentials can be created as environment variabl ## Accessing different endpoints -### Earthdata User Acceptance Testing (UAT) environment +### Earthdata User Acceptance Testing (UAT) endpoint If your EDL account is authorized to access the User Acceptance Testing (UAT) system, you can set earthaccess to work with its EDL and CMR endpoints From 43432309ffdb202c0712044712a1e5cadb6885ea Mon Sep 17 00:00:00 2001 From: Andy Barrett Date: Mon, 4 Nov 2024 12:30:33 -0700 Subject: [PATCH 13/15] Update docs/user_guide/authenticate.md Fix typo Co-authored-by: Matt Fisher <3608264+mfisher87@users.noreply.github.com> --- docs/user_guide/authenticate.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user_guide/authenticate.md b/docs/user_guide/authenticate.md index 7303b61f..37e71648 100644 --- a/docs/user_guide/authenticate.md +++ b/docs/user_guide/authenticate.md @@ -126,7 +126,7 @@ earthaccess.login(system=earthaccess.UAT) ``` -## Using `earthaccess` to get credentials +## Using `earthaccess` to get S3 credentials `earthaccess.login` is a very convenient way to manage and provide Earthdata Login credentials. `earthaccess.login` can also be used to obtain S3 credentials to access NASA Earthdata Cloud. If you use `earthaccess` to access data in the cloud, you do not have to use this option, `earthaccess` handles this. However, if you are using other packages, such as `h5coro`, `earthaccess` can save a lot of time. From f28a1e6ee965a7d96d581e515ce70717c1d667d4 Mon Sep 17 00:00:00 2001 From: Andy Barrett Date: Tue, 21 Jan 2025 12:21:04 -0700 Subject: [PATCH 14/15] add amonition wrt netrc on untrusted machines --- docs/user_guide/authenticate.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/user_guide/authenticate.md b/docs/user_guide/authenticate.md index 37e71648..247100ef 100644 --- a/docs/user_guide/authenticate.md +++ b/docs/user_guide/authenticate.md @@ -35,6 +35,12 @@ Setting `strategy=interactive` will force a manual login. ## Login using a `.netrc` +!!! warning "Do not use this strategy on untrusted machines or with shared accounts" + + `earthaccess` does not currently support encrypted `.netrc` files. This strategy of writing credentials in plain text to disk + should not be used on untrusted machines or shared user accounts. + + ### Creating a `.netrc` file #### Using `earthaccess.login` to create a `.netrc` file From 6ed6f55d7021c641d5859cdf51652b68f8a8dc4c Mon Sep 17 00:00:00 2001 From: Andy Barrett Date: Tue, 21 Jan 2025 12:27:25 -0700 Subject: [PATCH 15/15] add text to clarify setting env vars for linux shells --- docs/user_guide/authenticate.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/user_guide/authenticate.md b/docs/user_guide/authenticate.md index 247100ef..5122de0b 100644 --- a/docs/user_guide/authenticate.md +++ b/docs/user_guide/authenticate.md @@ -93,7 +93,7 @@ Alternatively, Earthdata Login credentials can be created as environment variabl export EARTHDATA_USERNAME="username" export EARTHDATA_PASSWORD="password" ``` - If you want to set these environmental variables permanently, add these two lines to your `.profile` file. + If you want to set these environmental variables permanently, add these two lines to the appropriate configuration files for your operating system. === "Linux" @@ -102,7 +102,12 @@ Alternatively, Earthdata Login credentials can be created as environment variabl export EARTHDATA_USERNAME="username" export EARTHDATA_PASSWORD="password" ``` - If you want to set these environmental variables permanently, add these two lines to your `.bashrc` file. + If you use `bash` and would like to set these environmental variables permanently, add these two lines to your `~/.profile` file: + ``` + EARTHDATA_USERNAME="username" + EARTHDATA_PASSWORD="password" + ``` + For other shells, use the recommended method to persistently set these environment variables for whichever shell you use. === "Windows" To set the environment variables for the current `CMD` session, type the following: