You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 19, 2024. It is now read-only.
Improve info about managing SSH keys in Cloud Guide (#8364)
* Fix broken link in Cloud Guide
* Add tip for managing SSH keys on Cloud projects
* Update src/_includes/cloud/enable-ssh.md
* Fix lint error
* Replace ssh-keygen instructions with link
- Replaced ssh-keygen instructions with link to GitHub documentation,
which provides instructions for Linux, macOS, and Windows.
- Clarified other instructions
* Apply suggestions from code review
Co-authored-by: hguthrie <[email protected]>
Co-authored-by: hguthrie <[email protected]>
Copy file name to clipboardExpand all lines: src/_includes/cloud/enable-ssh.md
+38-82Lines changed: 38 additions & 82 deletions
Original file line number
Diff line number
Diff line change
@@ -15,89 +15,31 @@ For more information on SSH keys, see the following:
15
15
16
16
## Locate an existing SSH key pair {#existing}
17
17
18
-
An existing SSH key pair is typically located in the `.ssh` subdirectory of the user's home directory. This folder is hidden and may not display in the file manager or finder unless configured to display hidden files and folders.
19
-
20
-
You can quickly verify if you have SSH keys by entering commands using terminal access.
21
-
22
-
To check for SSH keys, enter the following command:
23
-
24
-
```bash
25
-
ls ~/.ssh
26
-
```
27
-
28
-
If you have SSH keys, a directory listing is displayed similar to the following:
29
-
30
-
```terminal
31
-
id_rsa id_rsa.pub known_hosts
32
-
```
33
-
34
-
If you do not have SSH keys, you need to generate the keys for adding to your Magento ECE account and GitHub account. See [Create a new SSH key pair](#ssh-create-new-key-pair).
35
-
36
-
If you already have SSH keys, continue to:
37
-
38
-
-[Add a public SSH key to your Magento account](#ssh-add-to-account) section
39
-
-[Add your SSH key to your GitHub account](https://help.github.com/articles/adding-a-new-ssh-key-to-your-github-account/)
40
-
41
-
## Create a new SSH key pair {#ssh-create-new-key-pair}
42
-
43
-
Use the `ssh-keygen` command to create an SSH key pair. `ssh-keygen` is typically installed on Linux systems.
18
+
An existing SSH key pair is typically located in the `.ssh` subdirectory of the user home directory. This folder is hidden and may not display in the File Manager or Finder if your system is not configured to display hidden files and folders.
44
19
45
20
{:.procedure}
46
-
To create an SSH key pair:
21
+
To check for SSH keys:
47
22
48
-
1.The command syntax follows, entering the email used for your GitHub account:
23
+
1.In the terminal, list the contents of your SSH directory.
49
24
50
25
```bash
51
-
ssh-keygen -t rsa
26
+
ls ~/.ssh
52
27
```
53
28
54
-
GitHub also uses the key length `-b 4096` in the command. Follow the prompts to complete the key.
55
-
56
-
1. When prompted to "Enter a file in which to save the key," press **Enter** to save the file to the default location. The prompt displays the location.
57
-
58
-
1. When prompted to enter a secure passphrase, enter a phrase to use like a password. Make note of this passphrase. You may be requested to enter it depending on tasks you complete using a terminal during development.
29
+
1. Review the output.
59
30
60
-
1. After creating the SSH key pair, start the ssh-agent:
31
+
If you have SSH keys, a directory listing is displayed similar to the following:
61
32
62
-
For Mac or Linux:
63
-
64
-
```bash
65
-
eval"$(ssh-agent -s)"
33
+
```terminal
34
+
id_rsa id_rsa.pub known_hosts
66
35
```
67
36
68
-
For Mac, you can edit the `~/.ssh/config` file to automatically load keys into the ssh-agent and store passphrases in your keychain.
69
-
70
-
```conf
71
-
Host *
72
-
AddKeysToAgent yes
73
-
UseKeychain yes
74
-
IdentityFile ~/.ssh/id_rsa
75
-
```
37
+
If the directory does not exist or has no SSH key files, you must generate at least one SSH key and add it to your GitHub account. For instructions, see [Generate a new SSH key](https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent) in the GitHub documentation.
76
38
77
-
{:.bs-callout-info}
78
-
You can specify multiple SSH keys by adding multiple `IdentityFile` entries to your configuration.
39
+
If you have at least one SSH key in your directory, add the key to your Magento and GitHub accounts:
79
40
80
-
For Windows:
81
-
82
-
```shell
83
-
eval$(ssh-agent -s)
84
-
```
85
-
86
-
1. Add the SSH key to the ssh-agent. If you used a different name for the key file name, replace `id_rsa` with that file name.
87
-
88
-
For Mac:
89
-
90
-
```bash
91
-
ssh-add -K ~/.ssh/id_rsa
92
-
```
93
-
94
-
For Windows or Linux:
95
-
96
-
```shell
97
-
ssh-add ~/.ssh/id_rsa
98
-
```
99
-
100
-
1.[Add your SSH key to your GitHub account.](https://help.github.com/articles/adding-a-new-ssh-key-to-your-github-account/) The instructions include Mac, Windows, and Linux.
41
+
-[Add an SSH key to your GitHub account](https://help.github.com/articles/adding-a-new-ssh-key-to-your-github-account/)
42
+
-[Add your public SSH key to your Magento account](#ssh-add-to-account)
101
43
102
44
### Test the SSH keys {#test}
103
45
@@ -120,13 +62,14 @@ You can add SSH keys to your account in any of the following ways:
120
62
- Using the [{{site.data.var.ece}} CLI](#add-key-cli)
121
63
- Using the [{{site.data.var.ece}} Web Interface](#add-key-web)
122
64
123
-
### Add a key using the CLI {#add-key-cli}
65
+
### Add your SSH key using the CLI {#add-key-cli}
124
66
125
67
{:.procedure}
126
68
To add an SSH key using the CLI:
127
69
128
70
1. Open a terminal application on your local workstation.
129
-
1. If you haven't done so already, log in (or switch to) the [Magento file system owner]({{ site.baseurl }}/cloud/before/before-workspace-file-sys-owner.html) to the server on which your SSH keys are located.
71
+
72
+
1. If you have not done so already, log in (or switch to) the [Magento file system owner]({{ site.baseurl }}/cloud/before/before-workspace-file-sys-owner.html) to the server on which your SSH keys are located.
130
73
131
74
1. Log in to your project:
132
75
@@ -140,30 +83,43 @@ To add an SSH key using the CLI:
140
83
magento-cloud ssh-key:add ~/.ssh/id_rsa.pub
141
84
```
142
85
143
-
### Add a key using the Project Web Interface {#add-key-web}
86
+
{:.bs-callout-tip}
87
+
You can list and delete SSH keys using the Magento Cloud CLI commands `ssh-key:list` and `ssh-key:delete`.
144
88
145
-
You will select and add your SSH public key to each environment in your account.
89
+
### Add your SSH key using the Project Web Interface {#add-key-web}
90
+
91
+
You must add your SSH public key to your account. After you add the key, you must redeploy all active environments on your account to install the key.
146
92
147
93
- Starter: Add to Master (Production) and any environments you create by branching from Master
148
-
- Pro: Add the key to Staging, Production, and Integration environments
94
+
- Pro: Add the key to the Staging, Production, and Integration environments
149
95
150
96
{:.procedure}
151
-
To add an SSH key using the Project Web Interface:
97
+
To add an SSH key using the Project Web interface:
98
+
99
+
1. Get your public key.
152
100
153
-
1. Copy your SSH public key to the clipboard.
101
+
- In the terminal, navigate to the `~/.ssh` directory.
154
102
155
-
If you do not already have SSH keys on that machine, see [GitHub documentation](https://help.github.com/articles/generating-an-ssh-key) to create them.
103
+
- Copy the contents of the public key file `~/.ssh/<keyname>.pub` to the clipboard.
104
+
105
+
If there are no SSH key files in the directory, you must create one. See [Generate a new SSH key](https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent) in the GitHub documentation.
156
106
157
107
1. Login and access your project through the [Project Web Interface](https://accounts.magento.cloud).
158
-
1. In your selected branch, an icon displays if you do not have an SSH key added.
108
+
109
+
1. In your project, look for the **No SSH key** icon to the right of the command field. This icon is visible when the project does not contain an SSH key.
- Follow the prompts on your screen to complete the task.
165
120
166
-
1. Follow the prompts on your screen to complete the task.
121
+
{:.bs-callout-tip}
122
+
You can view and manage the SSH keys on your account in _Account settings_. In the upper right corner of the Project Web interface, click **your-user-name** > **Account Settings**.
Copy file name to clipboardExpand all lines: src/cloud/project/user-admin.md
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,7 @@ You can manage access to {{site.data.var.ece}} projects by adding users and assi
27
27
28
28
## Add user authentication requirements
29
29
30
-
For added security, Magento provides project-level MFA enforcement to require two-factor authentication for SSH access to {{ site.data.var.ece }} project source code and environments. See [MFA enforcement for SSH].
30
+
For added security, Magento provides project-level MFA enforcement to require two-factor authentication for SSH access to {{ site.data.var.ece }} project source code and environments. See [Enable MFA for SSH].
31
31
32
32
When MFA enforcement is enabled on a {{site.data.var.ece}} project, all users with SSH access to an environment in that project must enable two-factor authentication (TFA) on their {{site.data.var.ece}} account. For automated processes, users must create an API token that machine users can use to authenticate from the command line. See [Enable user accounts for TFA and SSH access](#update-account-security-settings).
33
33
@@ -44,7 +44,7 @@ To add a user to a project or environment, you need the email address associated
44
44
45
45
### Manage users with the CLI {#cloud-user-mg-cli}
46
46
47
-
You can use the {{site.data.var.ece}} command line client to manage users and integrate this with any other automated system.
47
+
Use the {{site.data.var.ece}} command line client to manage users and integrate this with any other automated system.
48
48
49
49
Available commands:
50
50
@@ -175,17 +175,17 @@ After you add a user to a Cloud project, ask the user to review their account se
175
175
176
176
- Enable two-factor authentication (TFA)
177
177
178
-
Magento recommends adding two-factor authentication to all accounts to meet security and compliance standards. Projects configured with [MFA enforcement][] require two-factor authentication for all accounts that require SSH access to {{site.data.var.ece}} projects.
178
+
Magento recommends adding two-factor authentication to all accounts to meet security and compliance standards. Projects configured with [MFA enforcement][Enable MFA for SSH] require two-factor authentication on accounts that use SSH to access the projects.
179
179
180
180
- Enable SSH keys
181
181
182
182
Users that require access to {{site.data.var.ece}} source code repositories and infrastructure must enable SSH keys on their account. See [Enable SSH keys][].
183
183
184
184
- Create an API token
185
185
186
-
You can generate an API token on your account that can be used for secure SSH access to an environment. You need the token to enable authentication workflows for automated processes.
186
+
Users can generate an API token that can be used for secure SSH access to an environment. You need the token to enable authentication workflows for automated processes.
187
187
188
-
On projects with MFA enforcement enabled, you must use the API token to authenticate SSH access requests from automated accounts to bypass authentication workflows which require two-factor authentication.
188
+
On projects with MFA enforcement enabled, you must use the API token to authenticate SSH access requests from automated accounts. The token allows automated processes to bypass authentication workflows which require two-factor authentication.
0 commit comments