Changeset 1962


Ignore:
Timestamp:
02/21/17 21:26:40 (7 years ago)
Author:
nanardon
Message:

Add notice for SSH + keys

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LATMOS-Accounts/man/man8/latmos-accounts-faq.pod

    r1013 r1962  
    33=head1 INTRODUCTION 
    44 
     5The goal of this docmuentation is to give soo clue about how to manage usuall 
     6issue with this software. 
     7 
    58=head1 FAQ 
    69 
     10=head2 Denying to locked user to login using SSH with key 
    711 
     12There is no way on linux to deny to expired or locked user to login using ssh 
     13and ssh key because sshd simply skip the authentification step on PAM and both 
     14checks are done here. 
     15 
     16On way could be to change the shell, this is what is done for standard C<passwd> 
     17database but you immediatelly feel this method is ugly and complex to code. 
     18 
     19After some wonder about how to do here the solution found as the best. 
     20 
     21In C<sshd_config> you can define users and groups not allow to login, and 
     22because this is managed by C<sshd> itself it will work whatever the login method 
     23is used. 
     24 
     25In the L<LATMOS::Accounts> database create groups to match user's states one for 
     26locked user and one for expired users (unexported user don't exists anymore, no 
     27need to filter them). 
     28 
     29Now add to both an C<autoMemberFilter> to match thoses users: 
     30 
     31For locked users: 
     32    autoMemberFilter: unexported=0 
     33    autoMemberFilter: locked=* 
     34 
     35For expired users: 
     36    autoMemberFilter: unexported=0 
     37    autoMemberFilter: expired=* 
     38 
     39Now add to you C<sshd_config>: 
     40 
     41    DenyGroups expired locked 
     42 
     43where C<expired> and C<locked> are the name of both groups. 
     44 
     45You're done, both groups will be update automatically according user's status 
     46and C<sshd> will reject them. 
     47 
Note: See TracChangeset for help on using the changeset viewer.