<div>I'm trying to get restricted ssh login working and running into an issue with pam_access.so and how it interprets netgroups. </div><div><br></div><div>Pam 1.1.3 on Ubuntu 12.04</div><div><br></div><div>Netgroup:</div>
<div>UserDev ( ,alloweduser, )</div><div>SystemDev (<a href="http://host.sub.domain.com">host.sub.domain.com</a>,,)</div><div><br></div><div>Here is the /etc/security/access.conf file:</div><div>+ : root :ALL</div><div>+ : @UserDev@@SystemDev : ALL</div>
<div><br></div><div>Relevant /etc/pam.d/sshd config:</div><div>account required pam_access.so debug</div><div><br></div><div>And here is what happens when alloweduser logs in via ssh:</div><div><br></div><div>login_access: user=alloweduser, from=192.168.1.10, file=/etc/security/access.conf</div>
<div>line 1: +  :  root : ALL</div><div>list_match: list= root , item=alloweduser</div><div>user_match: tok=root, item=alloweduser</div><div>string_match: tok=root, item=alloweduser</div><div>user_match=0, "alloweduser"</div>
<div>line 2: +  :  @UserDev@@SystemDev  :  ALL</div><div>list_match: list= @UserDev@@SystemDev , item=alloweduser</div><div>user_match: tok=@UserDev@@SystemDev, item=alloweduser</div><div>netgroup_match: 0 (netgroup=UserDev@@SystemDev, machine=NULL, user=alloweduser, domain=)</div>
<div>user_match=0, "alloweduser"</div><div>line 3: -  :  ALL  :  ALL</div><div>list_match: list= ALL , item=alloweduser</div><div>user_match: tok=ALL, item=alloweduser</div><div>string_match: tok=ALL, item=alloweduser</div>
<div>user_match=2, "alloweduser"</div><div>list_match: list= ALL, item=alloweduser</div><div>from_match: tok=ALL, item=192.168.1.10</div><div>string_match: tok=ALL, item=192.168.1.10</div><div>from_match=2, "192.168.1.10"</div>
<div>access denied for user `alloweduser' from `192.168.1.10'</div><div><br></div><div>Notice the line: netgroup_match: 0 (netgroup=UserDev@@SystemDev, machine=NULL, user=alloweduser, domain=)</div><div><br></div>
<div>It isn't correctly interpreting the netgroups as 2 separate groups, but one group named : UserDev@@SystemDev which obviously fails.</div><div><br></div><div>Here is a valid session with the same config on a CentOS 5.5 system.</div>
<div><br></div><div>login_access: user=alloweduser, from=192.168.1.20, file=/etc/security/access.conf</div><div>line 1: + : root : ALL</div><div>user_match: tok=root, item=alloweduser</div><div>string_match: tok=root, item=alloweduser</div>
<div>user_match=0, "alloweduser"</div><div>line 2: + : @UserDev@@SystemDev : ALL</div><div>user_match: tok=@UserDev@@SystemDev, item=alloweduser</div><div>user_match: tok=@UserDev, item=alloweduser</div><div>netgroup_match: 1 (group=UserDev, machine=NULL, user=alloweduser, domain=NULL)</div>
<div>from_match: tok=@SystemDev, item=devsystem2</div><div>netgroup_match: 1 (group=SystemDev, machine=devsystem2, user=NULL, domain=NULL)</div><div>user_match=1, "alloweduser"</div><div>from_match: tok=ALL, item=192.168.1.20</div>
<div>string_match: tok=ALL, item=192.168.1.20</div><div>from_match=2, "192.168.1.20"</div><div><br></div><div>Any help would be greatly appreciated.</div>