Skip to content

Commit 30bc62e

Browse files
Change SSH key generation instructions to use the Ed25519 algorithm (#940)
* Monitoring cluster nodes page changes * ed25519 changes in Co-authored-by: hubwriter <hubwriter@github.com>
1 parent 6e42676 commit 30bc62e

File tree

2 files changed

+25
-17
lines changed

2 files changed

+25
-17
lines changed

content/admin/enterprise-management/monitoring-cluster-nodes.md

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,26 +33,34 @@ You can configure [Nagios](https://www.nagios.org/) to monitor {% data variables
3333
#### Configuring the Nagios host
3434
1. Generate an SSH key with a blank passphrase. Nagios uses this to authenticate to the {% data variables.product.prodname_ghe_server %} cluster.
3535
```shell
36-
nagiosuser@nagios:~$ <em>ssh-keygen -t rsa -b 4096</em>
37-
> Generating public/private rsa key pair.
38-
> Enter file in which to save the key (/home/nagiosuser/.ssh/id_rsa):
36+
nagiosuser@nagios:~$ <em>ssh-keygen -t ed25519</em>
37+
> Generating public/private ed25519 key pair.
38+
> Enter file in which to save the key (/home/nagiosuser/.ssh/id_ed25519):
3939
> Enter passphrase (empty for no passphrase): <em>leave blank by pressing enter</em>
4040
> Enter same passphrase again: <em>press enter again</em>
41-
> Your identification has been saved in /home/nagiosuser/.ssh/id_rsa.
42-
> Your public key has been saved in /home/nagiosuser/.ssh/id_rsa.pub.
41+
> Your identification has been saved in /home/nagiosuser/.ssh/id_ed25519.
42+
> Your public key has been saved in /home/nagiosuser/.ssh/id_ed25519.pub.
4343
```
4444
{% danger %}
4545

4646
**Security Warning:** An SSH key without a passphrase can pose a security risk if authorized for full access to a host. Limit this key's authorization to a single read-only command.
4747

4848
{% enddanger %}
49-
2. Copy the private key (`id_rsa`) to the `nagios` home folder and set the appropriate ownership.
49+
{% note %}
50+
51+
**Note:** If you're using a distribution of Linux that doesn't support the Ed25519 algorithm, use the command:
52+
```shell
53+
nagiosuser@nagios:~$ ssh-keygen -t rsa -b 4096
54+
```
55+
56+
{% endnote %}
57+
2. Copy the private key (`id_ed25519`) to the `nagios` home folder and set the appropriate ownership.
5058
```shell
51-
nagiosuser@nagios:~$ <em>sudo cp .ssh/id_rsa /var/lib/nagios/.ssh/</em>
52-
nagiosuser@nagios:~$ <em>sudo chown nagios:nagios /var/lib/nagios/.ssh/id_rsa</em>
59+
nagiosuser@nagios:~$ <em>sudo cp .ssh/id_ed25519 /var/lib/nagios/.ssh/</em>
60+
nagiosuser@nagios:~$ <em>sudo chown nagios:nagios /var/lib/nagios/.ssh/id_ed25519</em>
5361
```
5462

55-
3. To authorize the public key to run *only* the `ghe-cluster-status -n` command, use a `command=` prefix in the `/data/user/common/authorized_keys` file. From the administrative shell on any node, modify this file to add the public key generated in step 1. For example: `command="/usr/local/bin/ghe-cluster-status -n" ssh-rsa AAAA....`
63+
3. To authorize the public key to run *only* the `ghe-cluster-status -n` command, use a `command=` prefix in the `/data/user/common/authorized_keys` file. From the administrative shell on any node, modify this file to add the public key generated in step 1. For example: `command="/usr/local/bin/ghe-cluster-status -n" ssh-ed25519 AAAA....`
5664

5765
4. Validate and copy the configuration to each node in the cluster by running `ghe-cluster-config-apply` on the node where you modified the `/data/user/common/authorized_keys` file.
5866

content/admin/policies/creating-a-pre-receive-hook-script.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ You can test a pre-receive hook script locally before you create or update it on
103103
adduser git -D -G root -h /home/git -s /bin/bash && \
104104
passwd -d git && \
105105
su git -c "mkdir /home/git/.ssh && \
106-
ssh-keygen -t rsa -b 4096 -f /home/git/.ssh/id_rsa -P '' && \
107-
mv /home/git/.ssh/id_rsa.pub /home/git/.ssh/authorized_keys && \
106+
ssh-keygen -t ed25519 -f /home/git/.ssh/id_ed25519 -P '' && \
107+
mv /home/git/.ssh/id_ed25519.pub /home/git/.ssh/authorized_keys && \
108108
mkdir /home/git/test.git && \
109109
git --bare init /home/git/test.git"
110110
@@ -136,17 +136,17 @@ You can test a pre-receive hook script locally before you create or update it on
136136
> Sending build context to Docker daemon 3.584 kB
137137
> Step 1 : FROM gliderlabs/alpine:3.3
138138
> ---> 8944964f99f4
139-
> Step 2 : RUN apk add --no-cache git openssh bash && ssh-keygen -A && sed -i "s/#AuthorizedKeysFile/AuthorizedKeysFile/g" /etc/ssh/sshd_config && adduser git -D -G root -h /home/git -s /bin/bash && passwd -d git && su git -c "mkdir /home/git/.ssh && ssh-keygen -t rsa -b 4096 -f /home/git/.ssh/id_rsa -P ' && mv /home/git/.ssh/id_rsa.pub /home/git/.ssh/authorized_keys && mkdir /home/git/test.git && git --bare init /home/git/test.git"
139+
> Step 2 : RUN apk add --no-cache git openssh bash && ssh-keygen -A && sed -i "s/#AuthorizedKeysFile/AuthorizedKeysFile/g" /etc/ssh/sshd_config && adduser git -D -G root -h /home/git -s /bin/bash && passwd -d git && su git -c "mkdir /home/git/.ssh && ssh-keygen -t ed25519 -f /home/git/.ssh/id_ed25519 -P ' && mv /home/git/.ssh/id_ed25519.pub /home/git/.ssh/authorized_keys && mkdir /home/git/test.git && git --bare init /home/git/test.git"
140140
> ---> Running in e9d79ab3b92c
141141
> fetch http://alpine.gliderlabs.com/alpine/v3.3/main/x86_64/APKINDEX.tar.gz
142142
> fetch http://alpine.gliderlabs.com/alpine/v3.3/community/x86_64/APKINDEX.tar.gz
143143
....truncated output....
144144
> OK: 34 MiB in 26 packages
145145
> ssh-keygen: generating new host keys: RSA DSA ECDSA ED25519
146146
> Password for git changed by root
147-
> Generating public/private rsa key pair.
148-
> Your identification has been saved in /home/git/.ssh/id_rsa.
149-
> Your public key has been saved in /home/git/.ssh/id_rsa.pub.
147+
> Generating public/private ed25519 key pair.
148+
> Your identification has been saved in /home/git/.ssh/id_ed25519.
149+
> Your public key has been saved in /home/git/.ssh/id_ed25519.pub.
150150
....truncated output....
151151
> Initialized empty Git repository in /home/git/test.git/
152152
> Successfully built dd8610c24f82
@@ -174,7 +174,7 @@ You can test a pre-receive hook script locally before you create or update it on
174174
9. Copy the generated SSH key from the data container to the local machine:
175175

176176
```shell
177-
$ docker cp data:/home/git/.ssh/id_rsa .
177+
$ docker cp data:/home/git/.ssh/id_ed25519 .
178178
```
179179

180180
10. Modify the remote of a test repository and push to the `test.git` repo within the Docker container. This example uses `git@github.com:octocat/Hello-World.git` but you can use any repo you want. This example assumes your local machine (127.0.0.1) is binding port 52311, but you can use a different IP address if docker is running on a remote machine.
@@ -183,7 +183,7 @@ You can test a pre-receive hook script locally before you create or update it on
183183
$ git clone git@github.com:octocat/Hello-World.git
184184
$ cd Hello-World
185185
$ git remote add test git@127.0.0.1:test.git
186-
$ GIT_SSH_COMMAND="ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 52311 -i ../id_rsa" git push -u test main
186+
$ GIT_SSH_COMMAND="ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 52311 -i ../id_ed25519" git push -u test main
187187
> Warning: Permanently added '[192.168.99.100]:52311' (ECDSA) to the list of known hosts.
188188
> Counting objects: 7, done.
189189
> Delta compression using up to 4 threads.

0 commit comments

Comments
 (0)