LinuxQuestions.org
Help answer threads with 0 replies.
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 05-17-2007, 11:00 PM   #1
bytez
LQ Newbie
 
Registered: Sep 2006
Location: USA
Distribution: CentOS 4.5
Posts: 27

Rep: Reputation: 15
secure /dev/shm


Quote:
/dev/shm isn't mounted with the noexec,nosuid options (currently: none). You should consider adding a mountpoint into /etc/fstab for /dev/shm with those options
Got this on my security check, could anyone tell me step by step how to secure it? Thanks so much!
 
Old 05-18-2007, 03:58 PM   #2
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
AFAICT, it probably wants a line like this in your /etc/fstab file:
Code:
devshm /dev/shm tmpfs rw,noexec,nosuid 0 0
 
Old 05-18-2007, 04:01 PM   #3
bytez
LQ Newbie
 
Registered: Sep 2006
Location: USA
Distribution: CentOS 4.5
Posts: 27

Original Poster
Rep: Reputation: 15
thanks, how to I edit the fstab file without breaking the system? Could I just use pico command?
 
Old 05-18-2007, 04:12 PM   #4
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
Quote:
Originally Posted by bytez
thanks, how to I edit the fstab file without breaking the system? Could I just use pico command?
well, my suggestion would be to first try it without editing the file... in other words, just remount your devshm with the new options... if anything goes wrong (unlikely but possible) you can just reboot and be done with it... check it:
Code:
win32sux@candystore:~$ mount | grep shm
devshm on /dev/shm type tmpfs (rw)
win32sux@candystore:~$ sudo mount -o rw,noexec,nosuid,remount -t tmpfs devshm /dev/shm
win32sux@candystore:~$ mount | grep shm
devshm on /dev/shm type tmpfs (rw,noexec,nosuid)
then when you are sure your box didn't break, make a backup of your fstab before editing it:
Code:
cat /etc/fstab > /etc/fstab.bak
this way if all hell breaks loose upon reboot then you can just boot a live cd and cat the backup file back into the proper one...

PS: yes, pico is fine, any text editor will do, really...

Last edited by win32sux; 05-18-2007 at 04:15 PM.
 
  


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
What is : /dev/shm PionexUser Linux - Newbie 4 03-14-2006 07:48 AM
/dev/shm? icecube Linux - Hardware 3 03-14-2006 07:34 AM
What is /dev/pts, /dev/shm? mrpc_cambodia Red Hat 1 10-18-2004 03:27 AM
What's the /dev/shm? antz1981cn Linux - Hardware 2 12-30-2002 01:55 PM
/dev/shm sakeeb Linux - Software 9 06-05-2002 06:03 AM

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

All times are GMT -5. The time now is 04:08 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
Open Source Consulting | Domain Registration