nebius / soperator

Run Slurm in Kubernetes
Apache License 2.0
107 stars 12 forks source link

sshd container failed to start: Directive 'MaxStartups' not allowed #204

Closed george-kuanli-peng closed 2 days ago

george-kuanli-peng commented 2 days ago

Tag: 1.15.3

In the login-0 pod, the sshd container failed to start with the following error message:

Start sshd daemon
/mnt/ssh-configs/sshd_config line 18: Directive 'MaxStartups' is not allowed within a Match block

The slurm1-ssh-configs configmap has these settings, generated by internal/render/login/configmap.go:

{
    "sshd_config": "LogLevel INFO
        Port 22
        PermitRootLogin yes
        PasswordAuthentication no
        ChallengeResponseAuthentication no
        UsePAM yes
        AcceptEnv LANG LC_*
        X11Forwarding no
        AllowTcpForwarding yes
        Subsystem sftp internal-sftp
        HostKey /etc/ssh/sshd_keys/ssh_host_rsa_key
        HostKey /etc/ssh/sshd_keys/ssh_host_ecdsa_key
        HostKey /etc/ssh/sshd_keys/ssh_host_ed25519_key
        Match User *
            ChrootDirectory /mnt/jail
        ClientAliveInterval 9000
        ClientAliveCountMax 3
        MaxStartups 10:30:60
        LoginGraceTime9000
        MaxAuthTries4"
}
george-kuanli-peng commented 2 days ago

It is also noted:

The complete fix could be:

        // res.AddLine("MaxStartups " + consts.SSHDMaxStartups)
        // res.AddLine("LoginGraceTime " + consts.SSHDLoginGraceTime)
        res.AddLine("MaxAuthTries " + consts.SSHDMaxAuthTries)
Uburro commented 2 days ago

HI. This issue has already been resolved. It will be included in the next release.

Uburro commented 2 days ago

1.15.2 version doesn't have this issue.

george-kuanli-peng commented 2 days ago

HI. This issue has already been resolved. It will be included in the next release.

Thanks a lot!