You are not logged in.

#1 2013-01-28 00:37:40

artomason
Member
Registered: 2013-01-27
Posts: 19

[SSH] Match Rules not Working

I'm currently in the process of migrating my Debian based server to an Arch based server. In the process of setting up SSH on the ArchLinux box everything seems to be working except the Match rules. Previously on my Debian box these SSHD_CONFIG settings worked flawlessly, however not so much as of right now.

$> /etc/ssh/sshd_config

# /etc/ssh/sshd_config: SSH Server Configuration
# See the sshd_config(5) manpage for details.

# Connection Settings
Port 6100
AddressFamily any
ListenAddress 192.168.100.100
Protocol 2

# General Server Settings
SyslogFacility AUTH
LogLevel ERROR
PidFile /run/sshd.pid
VersionAddendum none
PrintMotd no
PrintLastLog yes
Compression no

# Security Advisement Banner
# Banner /etc/issue

# Locale Environment Variables
AcceptEnv LANG LC_*

# SFTP Subsystem Location
Subsystem sftp internal-sftp

# Authentication Access Managers
UsePAM yes
UseLogin no

#General Authentication Settings
X11Forwarding no
X11UseLocalhost no
X11DisplayOffset 10
AllowAgentForwarding no
AllowTcpForwarding no
GatewayPorts no
PermitTunnel no
UseDNS yes

# Client Authentication Settings
PermitRootLogin no
PermitEmptyPasswords no
StrictModes yes
LoginGraceTime 30
MaxStartups 10
MaxSessions 10
MaxAuthTries 5
TCPKeepAlive no
ClientAliveInterval 30
ClientAliveCountMax 10
PermitUserEnvironment no
AuthorizedPrincipalsFile none

# Server Authentication Settings
UsePrivilegeSeparation yes
PubkeyAuthentication yes
HostbasedAuthentication no
PasswordAuthentication no
ChallengeResponseAuthentication no
IgnoreUserKnownHosts yes
IgnoreRhosts yes

# Authorized Public Keys
AuthorizedKeysFile %h/.ssh/publickey

# Protocol Version 2 Host Keys
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key

# Advanced (Match) Configuration
Match group ssh
        ChrootDirectory /%h/%u
        AllowTcpForwarding no

Match Address 192.168.100.0/24
        PermitRootLogin yes
        PubkeyAuthentication no
        PasswordAuthentication yes

The setup *should* allow me to use password authentication while connected to the LAN from any computer with no need for a publickey and I should beable to login with both root and my main user. However, when connecting from an external network (internet) it should deny root login and require a public key with no password authentication for all users. As of right now these setting are working as intended on the LAN, however on the external side the root user can still login, no publickey is used for authentication, and password authentication is still being used. When I commented out the "PermitRootLogin yes" section under the Match rule I could no longer login with root on both the LAN and the external network which makes me believe that this may be related to the "Match" rules. This configuration worked as intended on my old Debian box but not on my new ArchLinux box. Any ideas? ArchLinux is quite a bit different than my previous Debian box. On a side note, I have searched around and almost every post I came across was about troubleshooting public keys, and not so much related to my current problem. Here is the output of "systemctl status sshd" and I'm not sure how to pull a more detailed log for the service (still learning the distro)

sshd.service - OpenSSH Daemon
          Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled)
          Active: active (running) since Sun 2013-01-27 13:09:43 EST; 1h 19min ago
        Main PID: 294 (sshd)
          CGroup: name=systemd:/system/sshd.service
                  ââ294 /usr/sbin/sshd -D

Jan 27 13:09:43 srv.artomason.us systemd[1]: Started OpenSSH Daemon.
Jan 27 13:19:29 srv.artomason.us sshd[306]: pam_unix_session(sshd:session): session opened for user **** by (uid=0)
Jan 27 13:19:48 srv.artomason.us sshd[313]: pam_unix_session(sshd:session): session opened for user **** by (uid=0)
Jan 27 13:52:26 srv.artomason.us sshd[352]: pam_unix_session(sshd:session): session opened for user **** by (uid=0)
Jan 27 14:19:27 srv.artomason.us sshd[376]: pam_unix_session(sshd:session): session opened for user **** by (uid=0)

Let me know if you need any more information. Thanks!

Last edited by artomason (2013-01-28 00:37:58)

Offline

Board footer

Powered by FluxBB