<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Centos on despatches</title><link>https://icle.es/tags/centos/</link><description>Recent content in Centos on despatches</description><generator>Hugo</generator><language>en</language><lastBuildDate>Fri, 20 Jun 2025 09:25:00 +0100</lastBuildDate><atom:link href="https://icle.es/tags/centos/index.xml" rel="self" type="application/rss+xml"/><item><title>Restricting Linux Logins to Specified Group</title><link>https://icle.es/2012/03/21/restricting-linux-logins-to-specified-group/</link><pubDate>Wed, 21 Mar 2012 11:36:45 +0000</pubDate><guid>https://icle.es/2012/03/21/restricting-linux-logins-to-specified-group/</guid><description>&lt;p>If you have linux boxes that authenticate over ldap but want logins for specific
boxes to be restricted to a particular group, there is a simple way to achieve
this.&lt;/p>
&lt;p>Firstly, create a new file called &lt;code>/etc/group.login.allow&lt;/code> (it can be called
anything - you just need to update the line below to reflect the name)&lt;/p>
&lt;p>In this file, pop in all the groups that should be able to login&lt;/p>
```
admin
group1
group2
```
&lt;p>Edit &lt;code>/etc/pam.d/common-auth&lt;/code> (in ubuntu), it might be
called &lt;code>/etc/pam.d/system-auth&lt;/code> or something else very similar. At the top of
the file (or at least above other entries, add the following line:&lt;/p></description><content:encoded><![CDATA[<p>If you have linux boxes that authenticate over ldap but want logins for specific
boxes to be restricted to a particular group, there is a simple way to achieve
this.</p>
<p>Firstly, create a new file called <code>/etc/group.login.allow</code> (it can be called
anything - you just need to update the line below to reflect the name)</p>
<p>In this file, pop in all the groups that should be able to login</p>
```
admin
group1
group2
```
<p>Edit <code>/etc/pam.d/common-auth</code> (in ubuntu), it might be
called <code>/etc/pam.d/system-auth</code> or something else very similar. At the top of
the file (or at least above other entries, add the following line:</p>
```
auth required pam_listfile.so onerr=fail item=group sense=allow file=/etc/group.login.allow
```
<p>For the record, found this little tidbit
<a href="https://www.centos.org/modules/newbb/viewtopic.php?topic_id=25940" title="Allow Only Specific LDAP Group Access (CentOS Forums)">over at the centos forums</a>\</p>
]]></content:encoded></item></channel></rss>