Re: Negated patterns in AllowedUsers

Hi,
I need to login locally via ssh not by console. I want to incorporate
SSH keys and agent forwaring to verify who can logon as root.

Radek

Christian Grunfeld napsal(a):

Hi,

for root user is quite easy. Just put
PermitRootLogin No

in sshd_config

This only allow you to login thru local console

Christian

2007/9/2, Radek Hladik <radek@xxxxxxxxxx>:

Hi,
I am a little bit confused about patterns behavior when used in
AllowedUsers directive. I am trying to limit root logins to localhost.
First I tried
AllowedUsers root@localhost !root
which should enable root from localhost and all nonroot users from
anywhere. However the username part is matched with match_pattern
function and this function does not take ! into account (see func
match_user in match.c).
Secondly I tried
DenyUsers root@!localhost
which should deny root when logging from anywhere but localhost.
Function match_host_and_ip does call match_hostname which calls
match_pattern_list. But if match_hostname function returns -1 which
means "match found and negation was requested", match_host_and_ip return
false as there would be no match. As fact at least one _positive_ match
is required to return true:

Relevant Pages

Re: su: not running setuid... No I am not able to login as root from other consoles also. ... It is not accepting my uname and passwd. ... Can you even log in as root from the console?...(freebsd-questions)

Re: logging console login... What i want in common with Linux and Solaris is console logins to ... least network logins can be bared from root login and force people to login as themselves and switch user, but root login at the console is ...Solaris and Linux log this event without any further configuration, but with HP and AIX for that matter they dont at the moment. ...(comp.sys.hp.hpux)

SUMARY: Cant login as root... As a result, i was not able to log in as root, neither create a new ... Asunto: RE: Can't login as root ... > console.... > If we log as any other user everythig is ok, but we cannot either do su-. ...(Tru64-UNIX-Managers)

Re: Root password expired - not your typical case... Within the last couple days the root password expired.... When I attempt to login at the console as root, ... It is possible to disable root logins from the console and doing so is even recommended as a security precaution. ...(comp.unix.solaris)