The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

CSF Warning Query

Discussion in 'General Discussion' started by DReade83, Nov 20, 2006.

  1. DReade83

    DReade83 Well-Known Member

    Joined:
    Oct 20, 2006
    Messages:
    196
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Cheshire, UK
    I have the following warnings in my CSF Security Check screen:

    /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

    The servers runlevel is currently set to 4. For a secure server environment you should only run the server at runlevel 3. You can fix this by editing /etc/inittab and changing the initdefault line to:
    id:3:initdefault:
    and then rebooting the server

    I'm unsure about the first warning, but the second one I don't understand as the value it's asking me to change is already set to 'id:3:initdefault:' and the server has been rebooted too. Is this a bug?

    Any help would be greatly appreciated.

    Thanks in advance.
     
  2. mctDarren

    mctDarren Well-Known Member

    Joined:
    Jan 6, 2004
    Messages:
    664
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    New Jersey
    cPanel Access Level:
    Root Administrator
    The first one means that you don't have /dev/shm mounted as noexec, nosuid. Anyone may be able to run anything in that directory as a result. If you load /etc/fstab in your favorite text editor you'll probably see that it says "defaults" on the /dev/shm line. Change that to "noexec, nosuid" and you'll see that error (and some worries) disappear.

    The second one is strange. Is there a "#" at the start of the line. Or do you see that line again toward the end of the file with different settings? Were it my box, I would make the changes suggested, restart the machine and check /var/log/boot.log to see if you have anything funky happening on init. Do so at your own risk - my recommendation is to hire an admin to check over your machine for you if you're not sure what you're doing. :)
     
  3. nwilkens

    nwilkens Well-Known Member

    Joined:
    May 4, 2006
    Messages:
    59
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Monroe MI
    cPanel Access Level:
    DataCenter Provider
    Or post your inittab and fstab here, and we will help you edit them.

    Thanks,
    Nick
     
  4. DReade83

    DReade83 Well-Known Member

    Joined:
    Oct 20, 2006
    Messages:
    196
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Cheshire, UK
    OK, I've done the 'fstab' one - thanks for that.

    The 'inittab' file is as follows:

    Code:
    #
    # inittab       This file describes how the INIT process should set up
    #               the system in a certain run-level.
    #
    # Author:       Miquel van Smoorenburg, <miquels@drinkel.nl.mugnet.org>
    #               Modified for RHS Linux by Marc Ewing and Donnie Barnes
    #
    
    # Default runlevel. The runlevels used by RHS are:
    #   0 - halt (Do NOT set initdefault to this)
    #   1 - Single user mode
    #   2 - Multiuser, without NFS (The same as 3, if you do not have networking)
    #   3 - Full multiuser mode
    #   4 - unused
    #   5 - X11
    #   6 - reboot (Do NOT set initdefault to this)
    #
    id:3:initdefault:
    
    # System initialization.
    si::sysinit:/etc/rc.d/rc.sysinit
    
    l0:0:wait:/etc/rc.d/rc 0
    l1:1:wait:/etc/rc.d/rc 1
    l2:2:wait:/etc/rc.d/rc 2
    l3:3:wait:/etc/rc.d/rc 3
    l4:4:wait:/etc/rc.d/rc 4
    l5:5:wait:/etc/rc.d/rc 5
    l6:6:wait:/etc/rc.d/rc 6
    
    # Trap CTRL-ALT-DELETE
    ca::ctrlaltdel:/sbin/shutdown -t3 -r now
    
    # When our UPS tells us power has failed, assume we have a few minutes
    # of power left.  Schedule a shutdown for 2 minutes from now.
    # This does, of course, assume you have powerd installed and your
    # UPS connected and working correctly.
    pf::powerfail:/sbin/shutdown -f -h +2 "Power Failure; System Shutting Down"
    
    # If power was restored before the shutdown kicked in, cancel it.
    pr:12345:powerokwait:/sbin/shutdown -c "Power Restored; Shutdown Cancelled"
    
    
    # Run gettys in standard runlevels
    1:2345:respawn:/sbin/mingetty tty1
    2:2345:respawn:/sbin/mingetty tty2
    3:2345:respawn:/sbin/mingetty tty3
    4:2345:respawn:/sbin/mingetty tty4
    5:2345:respawn:/sbin/mingetty tty5
    6:2345:respawn:/sbin/mingetty tty6
    
    # Run xdm in runlevel 5
    x:5:respawn:/etc/X11/prefdm -nodaemon
     
  5. nwilkens

    nwilkens Well-Known Member

    Joined:
    May 4, 2006
    Messages:
    59
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Monroe MI
    cPanel Access Level:
    DataCenter Provider
    runlevel

    Your inittab appears OK, can you run 'who -r' on the command line?

    You should receive output like:

    # who -r
    run-level 3 Feb 25 10:44 last=S
     
  6. DReade83

    DReade83 Well-Known Member

    Joined:
    Oct 20, 2006
    Messages:
    196
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Cheshire, UK
    Hmm, interesting:

    Code:
    run-level 4  Nov 21 18:14                   last=S
    What could be causing that do you reckon?
     
  7. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    I would guess that it was set to run to runlevel 4 manually at the last reboot on the console.
     
  8. Denis Y. Frolov

    Denis Y. Frolov Registered

    Joined:
    Feb 19, 2007
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    /etc/fstab:

    but I still have the following warning in my CSF Security Check screen:

     
  9. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    Did you remount /dev/shm:

    mount -o remount /dev/shm
     
  10. Denis Y. Frolov

    Denis Y. Frolov Registered

    Joined:
    Feb 19, 2007
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    thanks a lot))
     
  11. yamaharr1

    yamaharr1 Well-Known Member

    Joined:
    Jun 22, 2007
    Messages:
    91
    Likes Received:
    0
    Trophy Points:
    6
    I am having this same problem after following this post and using mount -o remount /dev/shm it returns an error
    So I changed it back here is what is in fstab:

    ANyone know what I should do?
     
Loading...

Share This Page