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.

Suspicious file in /var/tmp/.X1-unix

Discussion in 'Security' started by postcd, Oct 1, 2015.

  1. postcd

    postcd Well-Known Member

    Joined:
    Oct 22, 2010
    Messages:
    621
    Likes Received:
    6
    Trophy Points:
    18
    Hello,

    i want to ask i got warning from firewall:

    File: /var/tmp/.X1-unix
    Reason: Suspicious directory

    it has rights of one of the cpanel accounts. i want to ask what is this /var/tmp and how it could create this file, how to prevent?
     
  2. dalem

    dalem Well-Known Member
    PartnerNOC

    Joined:
    Oct 24, 2003
    Messages:
    2,577
    Likes Received:
    40
    Trophy Points:
    48
    Location:
    SLC
    cPanel Access Level:
    DataCenter Provider
    /var/tmp is /tmp

    is symbolically linked
     
  3. lx24

    lx24 Member

    Joined:
    Oct 2, 2014
    Messages:
    21
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    You can find many threads around the fourm regarding securing tmp folder.

    Use : /scripts/securetmp
     
  4. postcd

    postcd Well-Known Member

    Joined:
    Oct 22, 2010
    Messages:
    621
    Likes Received:
    6
    Trophy Points:
    18
    /scripts/securetmp failes because OpenVZ which im using do not work with "loop devices", you taking like there can be more ways on how to secure /tmp, what are other ways except using loop device/s? thank you
     
  5. lx24

    lx24 Member

    Joined:
    Oct 2, 2014
    Messages:
    21
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Under VPS edit /etc/fstab,

    nano /etc/fstab

    and insert below lines,

    Code:
    mount /dev/loop0 -o noexec,nosuid,rw /dev/tmpFS /tmp
    mount /dev/loop0 /dev/tmpFS -o noexec,nosuid,rw
    Now run command below,

    Code:
    mount -obind,nosuid,noexec,nodev,rw /usr/tmp /tmp
    You /tmp is mounted now with noexec

    secure!
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,696
    Likes Received:
    656
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  7. postcd

    postcd Well-Known Member

    Joined:
    Oct 22, 2010
    Messages:
    621
    Likes Received:
    6
    Trophy Points:
    18
    I want to try it and update this thread with results, but can You please tell me what it basically do? How i can safelly revert that process? Thank you
     
  8. quizknows

    quizknows Well-Known Member

    Joined:
    Oct 20, 2009
    Messages:
    940
    Likes Received:
    55
    Trophy Points:
    28
    cPanel Access Level:
    DataCenter Provider
    I would advise against editing your /etc/fstab unless you are fully aware of the changes you are making and the implications of them. You can backup the file first before editing it and revert, however, you are changing file system mounting configuration by editing that file.

    If in doubt consult with your host. You mention that /scripts/securetmp fails due to lack of support for loop devices on your virtualiztaion platform: the advice given is using
    /dev/loop0 which will likely not work if the securetmp script does not work.
     
Loading...

Share This Page