sshd's controls (eg PasswordAuthentication and so forth) are quite coarse. It would be nice if there were finer-grained controls.
Created attachment 1118 [details] Add "Match" keyword to sshd_config This patch (against 4.3p2) extends sshd_config to support syntax such as: AllowTcpForwarding no Match Address 192.168.32.*,127.0.0.1 AllowTcpForwarding yes GatewayPorts no Match User bar,baz AllowTcpForwarding yes Match Host t* AllowTcpForwarding yes The criteria currently supported by Match are "User [user pattern-list]", "Group [group pattern]", "Address [address pattern-list]" and "Host [host pattern-list]". Multiple criteria may be specified on a single Match line, if so all criteria must match before the Match block takes effect (ie it is a logical AND). The directives supported inside a "Match" block are: AcceptEnv, AllowTcpForwarding, AuthorizedKeysFile, AuthorizedKeysFile2, Banner, ChallengeResponseAuthentication, ChallengeResponseAuthentication, ClientAliveCountMax, ClientAliveInterval, GatewayPorts, GssAuthentication, GssCleanupCreds, HostbasedAuthentication, HostbasedUsesNameFromPacketOnly, IgnoreRhosts, IgnoreUserKnownHosts, KbdInteractiveAuthentication, KerberosAuthentication, KerberosGetAFSToken, KerberosOrLocalPasswd, KerberosTicketCleanup, LogFacility, LogLevel, LoginGraceTime, MaxAuthTries, PasswordAuthentication, PermitEmptyPasswd, PermitRootLogin, PermitTunnel, PermitUserEnvironment, PrintLastLog, PrintMotd, PubkeyAuthentication, PubkeyAuthentication, RSAAuthentication, RhostsRSAAuthentication, StrictModes, UseLogin, UsePAM, X11DisplayOffset, X11Forwarding, X11UseLocalhost, XAuthLocation. Only a (small) subset of these have been tested.
Created attachment 1127 [details] Updated Match patch, against portable current. Added support for comma-separated group lists ("Match Group foo,bar"). Fixed leaks that occured when the ServerOption block was copied to the privsep slave.
The first part of Match has been committed (just a couple of directives so far) and so it will be in v4.4.
Created attachment 1184 [details] Add support for pre-authentication options to OpenSSH 4.4. Adds Match support for PasswordAuthentication and Banner.
Created attachment 1185 [details] Example of how to add further options to Match, Requires OpenSSH 4.4 and patch #1184.
*** Bug 22 has been marked as a duplicate of this bug. ***
Created attachment 1240 [details] Add support for auth types to Match This patch (against 4.5p1) allows a Match directive to control different authentication types. This patch was just committed and will be in 4.6 but I have been asked for it several times so did the (trivial) backport to 4.5p1 and am posting it here.
The authentications are now supported. I'll add the other options that make sense to support as time permits.
Close resolved bugs after release.