=====
case-insensitive directive with quoted argument
=====
authorizedKEYSfile "path to authorized keys file"

---

(server_config
  (keyword
    (alphanumeric)
    (arguments
      (string))))
=====
comment
=====
# authorizedkeysfile "path to authorized keys file"

---

(server_config
  (comment))
=====
case-insensitive match
=====
mAtCh user MyUser
authorizedkeysfile "path to authorized keys file"

---

(server_config
  (match
    (criteria
      (alpha)
      (argument
        (string)))
    (keyword
      (alphanumeric)
      (arguments
        (string)))))
=====
boolean and match
=====
permitrootlogin no
match user MyUser
authorizedkeysfile "path to authorized keys file"

---

(server_config
  (keyword
    (alphanumeric)
    (arguments
      (boolean)))
  (match
    (criteria
      (alpha)
      (argument
      (string)))
    (keyword
      (alphanumeric)
      (arguments
        (string)))))
=====
directive with = operator
=====
AllowTcpForwarding=local

---

(server_config
  (keyword
    (alphanumeric)
    (arguments
      (string))))
=====
directive with spaced = operator
=====
AllowTcpForwarding = local

---

(server_config
  (keyword
    (alphanumeric)
    (arguments
      (string))))
=====
directive with tab
=====
AllowTcpForwarding  local

---

(server_config
  (keyword
    (alphanumeric)
    (arguments
      (string))))
=====
directive with multiple arguments
=====
AllowGroups group1 "group two"

---

(server_config
  (keyword
    (alphanumeric)
    (arguments
      (string)
      (string))))
=====
directive with comma-separated arguments
=====
CASignatureAlgorithms ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp38

---

(server_config
  (keyword
    (alphanumeric)
    (arguments
      (string)
      (string)
      (string))))
=====
directive with '+' character
=====
CASignatureAlgorithms +ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp38

---

(server_config
  (keyword
    (alphanumeric)
    (operator)
    (arguments
      (string)
      (string)
      (string))))
=====
directive with '-' character
=====
CASignatureAlgorithms -ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp38

---

(server_config
  (keyword
    (alphanumeric)
    (operator)
    (arguments
      (string)
      (string)
      (string))))
=====
directive with integer value
=====
ClientAliveInterval 50

---

(server_config
  (keyword
    (alphanumeric)
    (arguments
      (number))))
=====
directive with unix path
=====
AuthorizedKeysFile ~/path/to/file

---

(server_config
  (keyword
    (alphanumeric)
    (arguments
      (string))))
=====
directive with '^' character value
=====
HostBasedAcceptedAlgorithms ^rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,ssh-ed25519

---

(server_config
  (keyword
    (alphanumeric)
    (operator)
    (arguments
      (string)
      (string)
      (string))))
=====
directive with '*' character value
=====
HostBasedAcceptedAlgorithms -rsa-*@openssh.com

---

(server_config
  (keyword
    (alphanumeric)
    (operator)
    (arguments
      (string))))
=====
directive with ip address
=====
ListenAddress 1.2.3.4:22

---

(server_config
  (keyword
    (alphanumeric)
    (arguments
      (string))))
=====
multiple match blocks
=====
match user A
gssapiauthentication yes
match user B
passwordauthentication yes

---

(server_config
  (match
    (criteria
      (alpha)
      (argument
      (string)))
    (keyword
      (alphanumeric)
      (arguments
        (boolean))))
  (match
    (criteria
      (alpha)
      (argument
      (string)))
    (keyword
      (alphanumeric)
      (arguments
        (boolean)))))
=====
directive with ':' operator
=====
MaxStartups 10:30:100

---

(server_config
  (keyword
    (alphanumeric)
    (arguments
      (string))))
=====
directive with '[]' operators
=====
PermitOpen [0001.a1b2.3333.4567]:2222

---

(server_config
  (keyword
    (alphanumeric)
    (arguments
      (string))))
=====
directive and string with spaces value
=====
Subsystem	sftp	sftp-server.exe -f LOCAL0 -l DEBUG3

---

(server_config
  (keyword
    (alphanumeric)
    (arguments
      (string)
      (string)
      (string)
      (string)
      (string)
      (string))))
=====
parse mini config
=====
syslogfacility LOCAL0
loglevel  DEBUG3
match user A
gssapiauthentication yes
authorizedkeysfile /path/to/file "C:\\users\\user\\file"
match user B
passwordauthentication yes

---
(server_config
  (keyword
    (alphanumeric)
    (arguments
      (string)))
  (keyword
    (alphanumeric)
    (arguments
      (string)))
  (match
    (criteria
      (alpha)
      (argument
      (string)))
    (keyword
      (alphanumeric)
      (arguments
        (boolean)))
    (keyword
      (alphanumeric)
      (arguments
        (string)
        (string))))
  (match
    (criteria
      (alpha)
      (argument
      (string)))
    (keyword
      (alphanumeric)
      (arguments
        (boolean)))))
====
parse directive with alpha-numeric characters
====
x11displayoffset 10

---
(server_config
  (keyword
    (alphanumeric)
    (arguments
      (number))))
====
parse directive with numbers
====
port 1234

---
(server_config
  (keyword
    (alphanumeric)
    (arguments
      (number))))
====
parse empty line
====


---
(server_config)
====
parse repeatable keyword
====
allowgroups administrators "openssh users"

---
(server_config
  (keyword
    (alphanumeric)
    (arguments
      (string)
      (string))))
====
parse repeatable strings without quotes
====
allowgroups groupOne groupTwo

---
(server_config
  (keyword
    (alphanumeric)
    (arguments
      (string)
      (string))))
====
parse comma separated string with quotes
====
ciphers "chacha20-poly1305@openssh.com,aes128-gcm@openssh.com"

---
(server_config
  (keyword
    (alphanumeric)
    (arguments
      (string)
      (string))))
====
parse single-quoted argument
====
allowgroups 'openssh users'

---
(server_config
  (keyword
    (alphanumeric)
    (arguments
      (string))))
====
parse multiple match criteria
====
match user User1,User2 Address 192.0.2.0/24
passwordauthentication no

---
(server_config
  (match
    (criteria
      (alpha)
      (argument
        (string)
        (string)))
    (criteria
      (alpha)
      (argument
        (string)))
    (keyword
      (alphanumeric)
        (arguments
          (boolean)))))
====
parse comments between keywords
====
port 2222 # use non-default port

---
(server_config
  (keyword
    (alphanumeric)
    (arguments
      (number))
    (comment)))
====
parse comments in match blocks
====
port 2222
passwordauthentication no

match User testuser # comment about criteria
    PasswordAuthentication yes
    AllowTcpForwarding no
# comment between match blocks
match Address 192.168.1.0/24
    X11Forwarding yes
    MaxAuthTries 3

---
(server_config
  (keyword
    (alphanumeric)
      (arguments
        (number)))
  (keyword
    (alphanumeric)
      (arguments
        (boolean)))
  (match
    (criteria
      (alpha)
      (argument
        (string)))
      (comment)
    (keyword
      (alphanumeric)
        (arguments
          (boolean)))
    (keyword
      (alphanumeric)
        (arguments
          (boolean)))
    (comment))
  (match
    (criteria
      (alpha)
      (argument
        (string)))
    (keyword
      (alphanumeric)
      (arguments
        (boolean)))
    (keyword
      (alphanumeric)
      (arguments
        (number)))))
====
parse newlines between match blocks
====
port 2222
passwordauthentication no

match User testuser
    PasswordAuthentication yes
    AllowTcpForwarding no

match Address 192.168.1.0/24
    X11Forwarding yes
    MaxAuthTries 3

---
(server_config
  (keyword
    (alphanumeric)
      (arguments
        (number)))
  (keyword
    (alphanumeric)
      (arguments
        (boolean)))
  (match
    (criteria
      (alpha)
      (argument
        (string)))
    (keyword
      (alphanumeric)
        (arguments
          (boolean)))
    (keyword
      (alphanumeric)
        (arguments
          (boolean))))
  (match
    (criteria
      (alpha)
      (argument
        (string)))
    (keyword
      (alphanumeric)
      (arguments
        (boolean)))
    (keyword
      (alphanumeric)
      (arguments
        (number)))))
====
parse comment within match block
====
match user developer
    # Enable password authentication for developers - comment ignored
    passwordauthentication yes

---
(server_config
  (match
    (criteria
      (alpha)
      (argument
        (string)))
    (comment)
    (keyword
      (alphanumeric)
      (arguments
        (boolean)))))
====
parse newlines between match blocks
====
match User testuser
    PasswordAuthentication yes
    AllowTcpForwarding no
    # comment line 1
    # comment line 2


match Address 192.168.1.0/24
    X11Forwarding yes
    MaxAuthTries 3

---
(server_config
  (match
    (criteria
      (alpha)
      (argument
        (string)))
    (keyword
      (alphanumeric)
      (arguments
        (boolean)))
    (keyword
      (alphanumeric)
      (arguments
        (boolean)))
    (comment)
    (comment))
  (match
    (criteria
      (alpha)
      (argument
        (string)))
    (keyword
      (alphanumeric)
      (arguments
        (boolean)))
    (keyword
      (alphanumeric)
      (arguments
        (number)))))
====
parse multiple comments and multiple lines
====
# comment line 1
# comment line 2
# comment line 3


passwordauthentication yes

---
(server_config
  (comment)
  (comment)
  (comment)
  (keyword
    (alphanumeric)
      (arguments
        (boolean))))
