# Test_sshd

Summary

Test_sshd |
Augeas Tests |
Sshd.lns | Indent when adding to a Match group
Sshd.lns | Parse Ciphers, KexAlgorithms, HostKeyAlgorithms as lists (GH issue #69) Parse GSSAPIKexAlgorithms, PubkeyAcceptedKeyTypes, CASignatureAlgorithms as lists (GH PR #721) Parse PubkeyAcceptedAlgorithms as a list (GH issue #804)
Sshd.lns | Keys are case-insensitive
Sshd.lns | Allow AllowGroups in Match groups (GH issue #75)
Sshd.lns | Recognize quoted group names with spaces in AllowGroups and similar (Issue #477)

### 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 Match Group \"Domain users\" X11Forwarding yes\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 HostKeyAlgorithms ssh-ed25519-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ssh-ed25519,ssh-rsa GSSAPIKexAlgorithms gss-curve25519-sha256-,gss-nistp256-sha256-,gss-group14-sha256- PubkeyAcceptedKeyTypes ecdsa-sha2-nistp256,ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384 PubkeyAcceptedAlgorithms ecdsa-sha2-nistp256,ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384 CASignatureAlgorithms ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521\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" } } { "HostKeyAlgorithms" { "1" = "ssh-ed25519-cert-v01@openssh.com" } { "2" = "ssh-rsa-cert-v01@openssh.com" } { "3" = "ssh-ed25519" } { "4" = "ssh-rsa" } } { "GSSAPIKexAlgorithms" { "1" = "gss-curve25519-sha256-" } { "2" = "gss-nistp256-sha256-" } { "3" = "gss-group14-sha256-" } } { "PubkeyAcceptedKeyTypes" { "1" = "ecdsa-sha2-nistp256" } { "2" = "ecdsa-sha2-nistp256-cert-v01@openssh.com" } { "3" = "ecdsa-sha2-nistp384" } } { "PubkeyAcceptedAlgorithms" { "1" = "ecdsa-sha2-nistp256" } { "2" = "ecdsa-sha2-nistp256-cert-v01@openssh.com" } { "3" = "ecdsa-sha2-nistp384" } } { "CASignatureAlgorithms" { "1" = "ecdsa-sha2-nistp256" } { "2" = "ecdsa-sha2-nistp384" } { "3" = "ecdsa-sha2-nistp521" } }

Parse Ciphers, KexAlgorithms, HostKeyAlgorithms as lists (GH issue #69) Parse GSSAPIKexAlgorithms, PubkeyAcceptedKeyTypes, CASignatureAlgorithms as lists (GH PR #721) Parse PubkeyAcceptedAlgorithms as a list (GH issue #804)

### 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)

### Sshd.lns

> test Sshd.lns get "Match User foo AllowGroups math-domain-users \"access admins\"\n" = { "Match" { "Condition" { "User" = "foo" } } { "Settings" { "AllowGroups" { "1" = "math-domain-users" } { "2" = "access admins" } } } }

Recognize quoted group names with spaces in AllowGroups and similar (Issue #477)

> 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 Match Group \"Domain users\" X11Forwarding yes\n"

Indent when adding to a Match group
Close