LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 10-30-2008, 04:50 PM   #1
investmentbnker75
Member
 
Registered: Oct 2007
Location: Eastern Seaboard
Distribution: CentOS
Posts: 162

Rep: Reputation: 15
Stopping non root users from being able to reboot a Linux server


I was reading a post that was submitted previously here, http://www.linuxquestions.org/questi...ing+the+system

and had more questions about this possibly happening and wondered if i can get some input. I have several RHEL4 servers that i want to make sure that non root users cant issue any init commands or shutdown commands or be able to ctrl+alt+backspace. I want only root and users in sudoers to be able to do this.

So to make sure that this can only be done with root or users in sudoers, will doing the following accomplish this?

changing /etc/inittab entry ca::ctrlaltdel:/sbin/shutdown -t3 -r now
to
ca::ctrlaltdel:ech0 Reboot/Shutdown is not possible at this time.

chmod /sbin/shutdown to 750

chmod /usr/bin/apmsleep to 750

removing everything in /etc/security/console.apps/

If there is any other steps that can be taken to prevent this, im all ears. Thanks in advance!
 
Old 10-30-2008, 08:01 PM   #2
FragInHell
Member
 
Registered: Sep 2003
Location: Sydney Australia
Distribution: Redhat, Centos, Solaris, Ubuntu, SUSE
Posts: 282

Rep: Reputation: 45
Hi,

Non Root users should not be able to issue init commands anyway. If they have physical access to the server then they can press CTRL+ATL+DEL you can edit /etc/inittab and comment out.
ca::ctrlaltdel:/sbin/shutdown -t3 -r now
so it should be
#ca::ctrlaltdel:/sbin/shutdown -t3 -r now

However if they have phyiscal access then there's nothing stopping them pressing the power button or removing the power cable.
Worst still is they can boot the server into single user mode as well and do what ever they like, unless you have a BIOS password and grub password.
 
Old 10-30-2008, 09:56 PM   #3
investmentbnker75
Member
 
Registered: Oct 2007
Location: Eastern Seaboard
Distribution: CentOS
Posts: 162

Original Poster
Rep: Reputation: 15
They dont have physical access so i was concerned mainly about command line commands that they could type like init 0, 1, 6 or shutdown commands. Is this a posibility or should the precautions i asked about earlier be taken?
 
Old 10-30-2008, 10:58 PM   #4
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Those commands can only be run by root. Check your kdm configuration to disable kdm from rebooting (if they log in that way).

Another possible loophole is PolicyKit, but rebooting should be disabled for remote users. You can read through the policies on your server to make sure.

Look in the Users & Security sections of your configuration settings program for RH. That is usually where you can easily change reboot settings. Not using RHEL myself, I can't be certain.

Check the sudoers configuration. Some allow all local users permission to run the shutdown command without a root password.

You may also want to log in remotely as a regular user and see if you can do it. ( Maybe do this real late at night, and if you can run shutdown, rerun it the the -c (cancel) option. )
 
  


Reply



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
RHEL3 Mounting USB after reboot and between reboots: root and non-root users Luis Nunes Linux - Hardware 0 07-20-2005 08:32 AM
How to allow certain non-root users to reboot?? jdaniel Linux - General 2 09-06-2004 10:05 AM
only root users can access vnc server dlm4444 Linux - Newbie 1 05-01-2004 02:47 PM
FTP Users are able to Traverse directories up to the root of my server stingay Red Hat 6 10-25-2003 03:22 AM
linux server stopping after blank screen davi_cabral Linux - Software 2 09-24-2003 12:15 PM

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

All times are GMT -5. The time now is 09:20 AM.

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
Open Source Consulting | Domain Registration