Skip to content

Commit 478cdb2

Browse files
aledbfclaude
andcommitted
harness: sshd -T's keywords in either case
The check looked for lowercase keywords and the root's OpenSSH 10.6 prints them capitalized, so a sshd configured as it should be failed it on every run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 737eb1c commit 478cdb2

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎cmd/image/test.go‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1373,7 +1373,8 @@ func sandboxedOK(out string) bool {
13731373
// firewall's check, under names of its own since deleting that one's is asynchronous - what the
13741374
// firewall lets through and logs, and sshd.service: off until started, then answering on port 22
13751375
// with the one key, Ed25519. A broadcast and an unasked port come first, so that the log's verdict
1376-
// on each is about this script's packets.
1376+
// on each is about this script's packets. sshd_config's keywords have no case, and OpenSSH's -T has
1377+
// printed them in both.
13771378
const sshOnNetworkScript = `echo enabled=$(systemctl is-enabled sshd.service); ` +
13781379
`nft list chain inet construct input | grep -q 3389; echo rdp=$?; ` +
13791380
`ip netns add sshtest && ip link add ssh0 type veth peer name ssh1 netns sshtest && ` +
@@ -1388,7 +1389,7 @@ const sshOnNetworkScript = `echo enabled=$(systemctl is-enabled sshd.service); `
13881389
`systemctl start sshd.service; echo start=$?; ` +
13891390
`ip netns exec sshtest timeout 5 bash -c 'exec 3<>/dev/tcp/10.99.1.1/22; head -1 <&3'; ` +
13901391
`echo keys=$(ls /etc/ssh/ssh_host_*_key); ` +
1391-
`sshd -T | grep -E '^(hostkeyalgorithms|passwordauthentication) '; ` +
1392+
`sshd -T | tr A-Z a-z | grep -E '^(hostkeyalgorithms|passwordauthentication) '; ` +
13921393
`systemctl stop sshd.service; ip netns del sshtest`
13931394

13941395
// sshOnNetworkOK is the verdict on what sshOnNetworkScript wrote.

0 commit comments

Comments
 (0)