Test_sshd

Summary
Test_sshd
Augeas Tests
Sshd.lnsIndent when adding to a Match group
Sshd.lnsParse Ciphers and KexAlgorithms as lists (GH issue #69)
Sshd.lnsKeys are case-insensitive
Sshd.lnsAllow AllowGroups in Match groups (GH issue #75)

Augeas Tests

Sshd.lns

test Sshd.lns put match_blocks after set "Match[1]/Settings/PermitRootLogin" "yes"; set "Match[1]/Settings/#comment" "a comment" = "X11Forwarding yes Match User sarko Group pres.* Banner /etc/bienvenue.txt X11Forwarding no PermitRootLogin yes # a comment Match User bush Group pres.* Host white.house.* Banner /etc/welcome.txt\n"

Indent when adding to a Match group

Sshd.lns

test Sshd.lns get "Ciphers aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes128-ctr KexAlgorithms diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1\n" = { "Ciphers" { "1" = "aes256-gcm@openssh.com" } { "2" = "aes128-gcm@openssh.com" } { "3" = "aes256-ctr" } { "4" = "aes128-ctr" } } { "KexAlgorithms" { "1" = "diffie-hellman-group-exchange-sha256" } { "2" = "diffie-hellman-group14-sha1" } { "3" = "diffie-hellman-group-exchange-sha1" } }

Parse Ciphers and KexAlgorithms as lists (GH issue #69)

Sshd.lns

test Sshd.lns get "ciPheRs aes256-gcm@openssh.com,aes128-ctr maTcH User foo x11forwarding no\n" = { "ciPheRs" { "1" = "aes256-gcm@openssh.com" } { "2" = "aes128-ctr" } } { "maTcH" { "Condition" { "User" = "foo" } } { "Settings" { "x11forwarding" = "no" } } }

Keys are case-insensitive

Sshd.lns

test Sshd.lns get "Match User foo AllowGroups users\n" = { "Match" { "Condition" { "User" = "foo" } } { "Settings" { "AllowGroups" { "1" = "users" } } } }

Allow AllowGroups in Match groups (GH issue #75)

test Sshd.lns put match_blocks after set "Match[1]/Settings/PermitRootLogin" "yes"; set "Match[1]/Settings/#comment" "a comment" = "X11Forwarding yes Match User sarko Group pres.* Banner /etc/bienvenue.txt X11Forwarding no PermitRootLogin yes # a comment Match User bush Group pres.* Host white.house.* Banner /etc/welcome.txt\n"
Indent when adding to a Match group
Close