You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

SSH Login Failed After Adding "AllowUsers" and "AllowGroups" Directives into /etc/ssh/sshd_config

edited Jun 30, 2022 5:36AM in Linux

Applies To:

Oracle Cloud Infrastructure - Version N/A and later

Linux OS - Version Oracle Linux 6.0 and later

Linux x86-64

Symptoms:

SSH client like PuTTY can return a failure like this:

disconnected: no supported authentication methods available (server sent: publickey, gssapi-with-mic)

Changes:

Added "AllowUsers" and "AllowGroups" directives into /etc/ssh/sshd_config.

Cause:

When adding "AllowUsers" and "AllowGroups", the target user must fulfill both directives, by its user name matching one of the patterns in the AllowUsers list AND by belonging to a group matching one of the patterns in the AllowGroups list.

SSHD_CONFIG(5) states:

The allow/deny directives are processed in the following order: DenyUsers, AllowUsers, DenyGroups, and finally AllowGroups.  All of the specified user and group tests must succeed, before user is allowed to log in.

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!