Skip to content
This repository has been archived by the owner on Oct 24, 2023. It is now read-only.

Commit

Permalink
fix: sshd config validation test on 20.04 (#5054)
Browse files Browse the repository at this point in the history
The sshd config validation test was failing on 20.04 environments, output:
Unable to load host key: /etc/ssh/ssh_host_rsa_key
Unable to load host key: /etc/ssh/ssh_host_dsa_key
Unable to load host key: /etc/ssh/ssh_host_ecdsa_key
Unable to load host key: /etc/ssh/ssh_host_ed25519_key
sshd: no hostkeys available -- exiting.
+ exit 1

The fix greps the sshd config file itself, and works on both 20.04 and 18.04
  • Loading branch information
christinalau0 authored Jan 26, 2023
1 parent 5a6ad49 commit b787675
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions test/e2e/kubernetes/scripts/sshd-config-validate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,15 @@ CONFIGS=("ClientAliveInterval 120"
"X11Forwarding no"
"MaxAuthTries 4"
"Banner /etc/issue.net"
"AcceptEnv LANG"
"AcceptEnv LC_*"
"AcceptEnv LANG LC_*"
"Subsystem sftp /usr/lib/openssh/sftp-server"
"UsePAM yes"
"UseDNS no"
"GSSAPIAuthentication no")

for ((i = 0; i < ${#CONFIGS[@]}; i++))
do
sshd -T | grep -i "${CONFIGS[$i]}" || exit 1
grep -i "${CONFIGS[$i]}" /etc/ssh/sshd_config || exit 1
done

CONFIGS=("RSAAuthentication yes"
Expand Down

0 comments on commit b787675

Please sign in to comment.