Skip to content

Commit 6b5622e

Browse files
docs(ONP): update SSH key creation page MTA-5865 (#4758)
* docs(ONP): update SSH key creation page MTA-5865 * Update pages/organizations-and-projects/how-to/create-ssh-key.mdx Co-authored-by: ldecarvalho-doc <[email protected]> --------- Co-authored-by: ldecarvalho-doc <[email protected]>
1 parent fb53150 commit 6b5622e

File tree

3 files changed

+109
-91
lines changed

3 files changed

+109
-91
lines changed
-9.67 KB
Loading

pages/instances/how-to/connect-to-instance.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ This page shows how to connect to your Scaleway Instance via SSH. Thanks to the
6464
click **Instances** in the Compute section of the side menu. A list of your
6565
Instances and their associated IP addresses will display.
6666
</Message>
67-
4. In the side menu, under **Connection**, navigate to the **Auth** sub-category. Do this by expanding **Connection**, then **SSH**, and finally clicking on **Auth**:
67+
4. In the side menu, expand the **Connection**, **SSH** and **Auth** submenus, then click **Credentials**:
6868
<Lightbox src="scaleway-putty-ssh.webp" alt="" />
6969
5. Click the **Browse** button and select the private key file you [generated previously](/organizations-and-projects/how-to/create-ssh-key/).
7070
6. Click **Open** at the bottom of the screen to open a connection to the Instance. Upon the first connection, PuTTY asks you to allow the connection to the host.

pages/organizations-and-projects/how-to/create-ssh-key.mdx

Lines changed: 108 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ content:
77
paragraph: This page explains how to generate an SSH key pair
88
tags: generate key ssh ssh-key create publickey public-key
99
dates:
10-
validation: 2024-12-19
10+
validation: 2025-04-01
1111
posted: 2021-06-08
1212
categories:
1313
- console
@@ -20,88 +20,104 @@ categories:
2020

2121
You can generate the SSH key pair on your local machine. The process will depend on your operating system.
2222

23-
<Macro id="requirements" />
24-
25-
- A Scaleway account logged into the [console](https://console.scaleway.com)
26-
- [Owner](/iam/concepts/#owner) status or [IAM permissions](/iam/concepts/#permission) allowing you to perform actions in the intended Organization
27-
28-
## How to generate an Ed25519 SSH key pair
23+
We recommend you use either:
2924

30-
### How to generate an Ed25519 SSH key pair on macOS and Linux
25+
- an [Ed25519 SSH key pair](#how-to-generate-an-ed25519-ssh-key-pair), to connect to your Linux-based Instances.
3126

32-
On macOS and Linux, you can generate the SSH key pair directly from the terminal.
27+
- an [RSA SSH key pair](#how-to-generate-a-rsa-ssh-key-pair), to connect to your Windows-based Instances.
3328

34-
1. Open the terminal application by clicking on the corresponding icon.
35-
<Lightbox src="scaleway-terminal-icon.webp" alt="Terminal Icon"/>
36-
2. Type the following command and press **Enter** to generate a new key:
37-
```bash
38-
ssh-keygen -t ed25519 -C "[email protected]"
39-
```
40-
<Message type="important">
41-
It is strongly recommended to use [Ed25519](https://en.wikipedia.org/wiki/EdDSA#Ed25519) for increased security and performance. If you cannot use Ed25519 keys, you can create an RSA4096 key as a fallback option:
42-
```bash
43-
ssh-keygen -o -b 4096 -C "[email protected]"
44-
```
45-
</Message>
46-
3. When prompted to enter a file path in which to save the key, either specify a path or press **Enter** to accept the default location (`~/.ssh/id_ed25519`).
47-
```
48-
Enter file in which to save the key (~/.ssh/id_ed25519):
49-
```
50-
4. Enter a passphrase when prompted. This step is optional but recommended for increased security. If you do not want to set a passphrase, press **Enter** directly.
51-
```
52-
Enter passphrase (empty for no passphrase):
53-
```
54-
5. Confirm the passphrase by entering it again when prompted, and press **Enter**:
55-
```
56-
Enter same passphrase again:
57-
```
29+
<Macro id="requirements" />
5830

59-
The key pair will be generated in the specified filepath. The key pair consists of:
60-
- The public key, named `id_ed25519.pub`
61-
- The private key, named `id_ed25519`
62-
<Message type="important">
63-
Ensure that the private key file (`<key_name>`) is kept secure. Do not share it with unauthorized parties. You can set appropriate permissions on the file to restrict access using the following command:
64-
```bash
65-
chmod 600 <key_name>
66-
```
67-
</Message>
68-
6. Display the content of the public key with the following command and copy it:
69-
```bash
70-
cat ~/.ssh/id_ed25519.pub
71-
```
72-
7. Copy the content of the public key displayed. You will need this in the next step. It should look something like this:
73-
```
74-
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINPZxtCMs5sIfsMWpq7SHuqFFpBtSTmFqXWOYdf6dX4i [email protected]
75-
```
31+
- A Scaleway account logged into the [console](https://console.scaleway.com)
32+
- [Owner](/iam/concepts/#owner) status or [IAM permissions](/iam/concepts/#permission) allowing you to perform actions in the intended Organization
7633

77-
### How to generate an Ed25519 SSH key pair on Windows
78-
79-
On Windows, you can use the third-party application [PuTTYgen](https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html) to generate an SSH key pair.
80-
81-
1. Download and install [PuTTY](https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html) on your local computer. The **PuTTYgen** application is automatically installed along with the main PuTTY application.
82-
<Lightbox src="scaleway-puttygen-app.webp" alt="PuTTYgen App"/>
83-
2. Launch PuTTYgen by double-clicking the application icon.
84-
3. Select **EdDSA** and click the **Generate** button. You can also add a passphrase before generating the key to increase security.
85-
<Lightbox src="scaleway-puttygen-01.webp" alt="PuTTYgen Generate Key"/>
86-
4. Move the mouse around the blank area as instructed to generate randomness.
87-
<Lightbox src="scaleway-puttygen-02.webp" alt="PuTTYgen Randomness"/>
88-
89-
The public and private key are generated, and the following screen will display:
90-
<Lightbox src="scaleway-puttygen-03.webp" alt="PuTTYgen Keys Generated"/>
91-
5. Complete the steps on the screen to finish:
92-
- Fill in the **Key comment** field with a name to help you identify this key pair.
93-
- Click the **Save public key** button and save it in the folder of your choice.
94-
- Click the **Save private key** button to save it in the same folder.
95-
<Message type="important">
96-
Ensure that the private key file (`<key_name>`) is kept secure. Do not share it with unauthorized parties.
97-
</Message>
98-
- Select the content of the public key (the sequence of characters under "Public key for pasting into OpenSSH authorized_keys file") and copy it, as you will need this in the next step/
99-
100-
## How to generate a RSA SSH key pair
101-
102-
<Message type="tip">
103-
- Windows-based Instances require a special type of SSH key known as RSA (Rivest-Shamir-Adleman), a prevalent asymmetric cryptographic algorithm used for secure data transmission.
104-
- It is recommended to use [Ed25519 keys](#how-to-generate-an-ed25519-ssh-key-pair) for SSH connections to your Linux Instances.
34+
## How to generate an SSH key pair
35+
36+
### How to generate an Ed25519 SSH key pair
37+
38+
Ed25519 SSH key pairs allow you to connect to your Linux-based Instances from a macOS, Linux or Windows machine.
39+
40+
<Tabs id="Ed25519-ssh-key-pair">
41+
<TabsTab label="macOS and Linux">
42+
43+
On macOS and Linux, you can generate the SSH key pair directly from the terminal.
44+
45+
1. Open a terminal.
46+
47+
2. Run the following command to generate a new key:
48+
```bash
49+
ssh-keygen -t ed25519 -C "[email protected]"
50+
```
51+
<Message type="important">
52+
It is strongly recommended to use [Ed25519](https://en.wikipedia.org/wiki/EdDSA#Ed25519) for increased security and performance. If you cannot use Ed25519 keys, you can create an RSA4096 key as a fallback option:
53+
```bash
54+
ssh-keygen -o -b 4096 -C "[email protected]"
55+
```
56+
</Message>
57+
3. When prompted to enter a file path in which to save the key, either specify a path or press **Enter** to accept the default location (`~/.ssh/id_ed25519`).
58+
```
59+
Enter file in which to save the key (~/.ssh/id_ed25519):
60+
```
61+
4. Enter a passphrase when prompted. This step is optional but recommended for increased security. If you do not want to set a passphrase, press **Enter** directly.
62+
```
63+
Enter passphrase (empty for no passphrase):
64+
```
65+
5. Confirm the passphrase by entering it again when prompted, and press **Enter**:
66+
```
67+
Enter same passphrase again:
68+
```
69+
70+
The key pair will be generated in the specified filepath. The key pair consists of:
71+
- The public key, named `id_ed25519.pub`
72+
- The private key, named `id_ed25519`
73+
<Message type="important">
74+
Ensure that the private key file (`<key_name>`) is kept secure. Do not share it with unauthorized parties. You can set appropriate permissions on the file to restrict access using the following command:
75+
```bash
76+
chmod 600 <key_name>
77+
```
78+
</Message>
79+
6. Display the content of the public key with the following command and copy it:
80+
```bash
81+
cat ~/.ssh/id_ed25519.pub
82+
```
83+
An output similar to the following displays:
84+
```
85+
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINPZxtCMs5sIfsMWpq7SHuqFFpBtSTmFqXWOYdf6dX4i [email protected]
86+
```
87+
7. Copy the content of the public key displayed, as you will need this in the next step.
88+
89+
</TabsTab>
90+
<TabsTab label="Windows">
91+
92+
On Windows, you can use the third-party application [PuTTYgen](https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html) to generate an SSH key pair.
93+
94+
1. Download and install [PuTTY](https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html) on your local computer. The **PuTTYgen** application is automatically installed along with the main PuTTY application.
95+
<Lightbox src="scaleway-puttygen-app.webp" alt="PuTTYgen App"/>
96+
2. Launch PuTTYgen by double-clicking the application icon.
97+
3. Select **EdDSA** and click the **Generate** button. You can also add a passphrase before generating the key to increase security.
98+
<Lightbox src="scaleway-puttygen-01.webp" alt="PuTTYgen Generate Key"/>
99+
4. Move the mouse around the blank area as instructed to generate randomness.
100+
<Lightbox src="scaleway-puttygen-02.webp" alt="PuTTYgen Randomness"/>
101+
102+
The public and private key are generated, and the following screen will display:
103+
<Lightbox src="scaleway-puttygen-03.webp" alt="PuTTYgen Keys Generated"/>
104+
5. Complete the steps on the screen to finish:
105+
- Fill in the **Key comment** field with a name to help you identify this key pair.
106+
- Click the **Save public key** button and save it in the folder of your choice.
107+
- Click the **Save private key** button to save it in the same folder.
108+
<Message type="important">
109+
Ensure that the private key file (`<key_name>`) is kept secure. Do not share it with unauthorized parties.
110+
</Message>
111+
- Select the content of the public key (the sequence of characters under "Public key for pasting into OpenSSH authorized_keys file") and copy it, as you will need this in the next step.
112+
</TabsTab>
113+
</Tabs>
114+
115+
### How to generate a RSA SSH key pair
116+
117+
RSA SSH key pairs allow you to connect to your Windows-based Instances from a macOS, Linux or Windows machine. RSA (Rivest-Shamir-Adleman) is a prevalent asymmetric cryptographic algorithm used for secure data transmission.
118+
119+
<Message type="note">
120+
We recommend you use [Ed25519 keys](#how-to-generate-an-ed25519-ssh-key-pair) for SSH connections to your Linux Instances.
105121
</Message>
106122

107123
1. Open a terminal or command prompt on your local machine. This could be Terminal on macOS/Linux or the Command Prompt/PowerShell on Windows.
@@ -127,19 +143,21 @@ On Windows, you can use the third-party application [PuTTYgen](https://www.chiar
127143

128144
You must upload the content of the public part of the SSH key pair you just generated to the Scaleway interface. This is then transferred to your Instance during the boot process. You can then connect and authenticate from your local machine, where your private key is stored, to the remote Instance, where the public key can be found.
129145

130-
1. Log into the [Scaleway console](https://console.scaleway.com), and navigate to the [Credentials](/iam/concepts/#api-key) tab of your Project Dashboard:
131-
<Lightbox src="scaleway-credentials-nav.webp" alt="" />
132-
2. Scroll down to the **SSH key** section, and click **Add a new SSH key**.
133-
<Lightbox src="scaleway-ssh-keys.webp" alt="" />
134-
3. Paste the content of the public key (which you copied in the previous step) into the pop-up box, and optionally add a description. Then click **Add an SSH key**.
146+
1. Log into the [Scaleway console](https://console.scaleway.com).
135147

136-
You will now be able to [connect to your Instances via SSH](/instances/how-to/connect-to-instance/).
148+
2. Click the name of your Organization in the top-right corner, then select **SSH Keys**.
137149

138-
<Message type="tip">
139-
If you have any difficulties connecting to an Instance after uploading a new public SSH key to your Project, try the following:
140-
- If you cannot connect to your Instance at all via SSH, reboot your Instance from the console and try again.
141-
- If you can connect to your Instance using a previously uploaded SSH key but not the new one, go ahead and connect to your Instance with the old key. Once connected, run the `scw-fetch-ssh-keys --upgrade` command, which launches a script on your Instance to update your SSH keys. You can then check that the new key has been added to the `authorized_keys` file (`~/.ssh/authorized_keys`). Note that this command works only for Instances.
142-
- For further information, refer to the [SSH connection troubleshooting](/instances/troubleshooting/cant-connect-ssh/) documentation.
143-
</Message>
150+
2. Click **+ Add SSH key**. A popup displays.
151+
152+
3. Enter a name for your SSH key, paste the content of the public key copied earlier into the **Public key** box, then click **Add SSH key**.
153+
154+
You can now [connect to your Instances via SSH](/instances/how-to/connect-to-instance/).
155+
156+
## Troubleshooting
157+
158+
If you have any difficulties connecting to an Instance after uploading a new public SSH key to your Project, try the following:
144159

160+
- If you cannot connect to your Instance at all via SSH, reboot your Instance from the console and try again.
161+
- If you can connect to your Instance using a previously uploaded SSH key but not the new one, go ahead and connect to your Instance with the old key. Once connected, run the `scw-fetch-ssh-keys --upgrade` command, which launches a script on your Instance to update your SSH keys. You can then check that the new key has been added to the `authorized_keys` file (`~/.ssh/authorized_keys`). Note that this command works only for Instances.
145162

163+
For further information, refer to the dedicated [SSH connection troubleshooting](/instances/troubleshooting/cant-connect-ssh/) documentation.

0 commit comments

Comments
 (0)