LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 04-29-2015, 08:35 AM   #1
jakep219
LQ Newbie
 
Registered: Jun 2012
Posts: 11

Rep: Reputation: 0
(debian) etc/security/limits.conf maxlogins


My goal is to limit the root user to one login on the system.
I appended a line to /etc/security/limits.conf file

Code:
root - maxlogins 1
After a reboot, I am still able to have multiple simultanious root users logged in on different TTYs (no ssh). I tried changing the code to
Code:
root soft maxlogins 1
with no luck AND
Code:
root hard maxlogins 1
still with no luck.

What is going on? Why am I still able to have simultanious root logins on my machine?

PS, No other additional configurations are in the file.
PPS, I decided to add a new line to prevent the only non-root user from multiple logins the same way and it works. It would appear this rule is not being applied to root for some reason. Please give me some insight.

Last edited by jakep219; 04-29-2015 at 08:36 AM. Reason: could this be a rootkit or some other form of **ckery?
 
Old 04-29-2015, 09:27 AM   #2
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Yawnstown, Ohio
Distribution: Mojave
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Code:
man limits.conf
says
Code:
maxlogins
               maximum number of logins for this user except for this with uid=0
 
1 members found this post helpful.
Old 04-29-2015, 09:31 AM   #3
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,814
Blog Entries: 15

Rep: Reputation: 1661Reputation: 1661Reputation: 1661Reputation: 1661Reputation: 1661Reputation: 1661Reputation: 1661Reputation: 1661Reputation: 1661Reputation: 1661Reputation: 1661
uid=0 of course meaning the root user (or any bogus other users idiots create with the same uid 0 thinking it somehow protects them from just giving out the root password).
 
Old 04-29-2015, 09:44 AM   #4
jakep219
LQ Newbie
 
Registered: Jun 2012
Posts: 11

Original Poster
Rep: Reputation: 0
Thanks for the responses. Is there a way to effectively enforce this limit on the root user?
 
Old 04-29-2015, 09:51 AM   #5
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,814
Blog Entries: 15

Rep: Reputation: 1661Reputation: 1661Reputation: 1661Reputation: 1661Reputation: 1661Reputation: 1661Reputation: 1661Reputation: 1661Reputation: 1661Reputation: 1661Reputation: 1661
You might want to investigate use of /etc/securetty (man securetty to see details) as a more reasonable way of controlling root access by device rather than by number of logins.

If you restrict root login to the console and setup sudo to allow only certain admins to do "sudo su -" to become root you might more effectively both control who becomes root and log who does.
 
  


Reply

Tags
debian, limits.conf


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
maxlogins in /etc/security/limits.conf Mario Blunk SUSE / openSUSE 8 03-19-2015 02:09 AM
Setting limits in /etc/security/limits.conf vaibhav.vsk Linux - Security 1 09-20-2012 08:22 AM
regardig /etc/security/limits.conf niaz_ph Linux - Newbie 1 10-20-2011 09:58 AM
etc/security/limits.conf - what does it do? Ken_1969 Red Hat 5 03-14-2010 04:25 PM
/etc/security/limits.conf reverse Linux - Security 4 10-20-2007 03:10 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 11:03 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration