diff --git a/content/admin/enterprise-management/monitoring-cluster-nodes.md b/content/admin/enterprise-management/monitoring-cluster-nodes.md index 6d6c8ba3409d..da5fcdd1c91b 100644 --- a/content/admin/enterprise-management/monitoring-cluster-nodes.md +++ b/content/admin/enterprise-management/monitoring-cluster-nodes.md @@ -33,26 +33,34 @@ You can configure [Nagios](https://www.nagios.org/) to monitor {% data variables #### Configuring the Nagios host 1. Generate an SSH key with a blank passphrase. Nagios uses this to authenticate to the {% data variables.product.prodname_ghe_server %} cluster. ```shell - nagiosuser@nagios:~$ ssh-keygen -t rsa -b 4096 - > Generating public/private rsa key pair. - > Enter file in which to save the key (/home/nagiosuser/.ssh/id_rsa): + nagiosuser@nagios:~$ ssh-keygen -t ed25519 + > Generating public/private ed25519 key pair. + > Enter file in which to save the key (/home/nagiosuser/.ssh/id_ed25519): > Enter passphrase (empty for no passphrase): leave blank by pressing enter > Enter same passphrase again: press enter again - > Your identification has been saved in /home/nagiosuser/.ssh/id_rsa. - > Your public key has been saved in /home/nagiosuser/.ssh/id_rsa.pub. + > Your identification has been saved in /home/nagiosuser/.ssh/id_ed25519. + > Your public key has been saved in /home/nagiosuser/.ssh/id_ed25519.pub. ``` {% danger %} **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. {% enddanger %} -2. Copy the private key (`id_rsa`) to the `nagios` home folder and set the appropriate ownership. + {% note %} + + **Note:** If you're using a distribution of Linux that doesn't support the Ed25519 algorithm, use the command: + ```shell + nagiosuser@nagios:~$ ssh-keygen -t rsa -b 4096 + ``` + + {% endnote %} +2. Copy the private key (`id_ed25519`) to the `nagios` home folder and set the appropriate ownership. ```shell - nagiosuser@nagios:~$ sudo cp .ssh/id_rsa /var/lib/nagios/.ssh/ - nagiosuser@nagios:~$ sudo chown nagios:nagios /var/lib/nagios/.ssh/id_rsa + nagiosuser@nagios:~$ sudo cp .ssh/id_ed25519 /var/lib/nagios/.ssh/ + nagiosuser@nagios:~$ sudo chown nagios:nagios /var/lib/nagios/.ssh/id_ed25519 ``` -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....` +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....` 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. diff --git a/content/admin/policies/creating-a-pre-receive-hook-script.md b/content/admin/policies/creating-a-pre-receive-hook-script.md index 933d7d8998b0..9a37b9dee71d 100644 --- a/content/admin/policies/creating-a-pre-receive-hook-script.md +++ b/content/admin/policies/creating-a-pre-receive-hook-script.md @@ -103,8 +103,8 @@ You can test a pre-receive hook script locally before you create or update it on 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 && \ + 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" @@ -136,7 +136,7 @@ You can test a pre-receive hook script locally before you create or update it on > Sending build context to Docker daemon 3.584 kB > Step 1 : FROM gliderlabs/alpine:3.3 > ---> 8944964f99f4 - > 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" + > 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" > ---> Running in e9d79ab3b92c > fetch http://alpine.gliderlabs.com/alpine/v3.3/main/x86_64/APKINDEX.tar.gz > fetch http://alpine.gliderlabs.com/alpine/v3.3/community/x86_64/APKINDEX.tar.gz @@ -144,9 +144,9 @@ You can test a pre-receive hook script locally before you create or update it on > OK: 34 MiB in 26 packages > ssh-keygen: generating new host keys: RSA DSA ECDSA ED25519 > Password for git changed by root - > Generating public/private rsa key pair. - > Your identification has been saved in /home/git/.ssh/id_rsa. - > Your public key has been saved in /home/git/.ssh/id_rsa.pub. + > Generating public/private ed25519 key pair. + > Your identification has been saved in /home/git/.ssh/id_ed25519. + > Your public key has been saved in /home/git/.ssh/id_ed25519.pub. ....truncated output.... > Initialized empty Git repository in /home/git/test.git/ > Successfully built dd8610c24f82 @@ -174,7 +174,7 @@ You can test a pre-receive hook script locally before you create or update it on 9. Copy the generated SSH key from the data container to the local machine: ```shell - $ docker cp data:/home/git/.ssh/id_rsa . + $ docker cp data:/home/git/.ssh/id_ed25519 . ``` 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 $ git clone git@github.com:octocat/Hello-World.git $ cd Hello-World $ git remote add test git@127.0.0.1:test.git - $ GIT_SSH_COMMAND="ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 52311 -i ../id_rsa" git push -u test main + $ GIT_SSH_COMMAND="ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 52311 -i ../id_ed25519" git push -u test main > Warning: Permanently added '[192.168.99.100]:52311' (ECDSA) to the list of known hosts. > Counting objects: 7, done. > Delta compression using up to 4 threads.