Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

prevent users from editing or deleting .bash_history

Discussion in 'General Discussion' started by mahinder, Apr 29, 2009.

  1. mahinder

    mahinder Well-Known Member

    Joined:
    Jun 12, 2003
    Messages:
    69
    Likes Received:
    0
    Trophy Points:
    156
    Location:
    matrix
    how do i prevent users from editing or deleting .bash_history file?
     
  2. PlatinumServerM

    PlatinumServerM Well-Known Member
    PartnerNOC

    Joined:
    Jul 10, 2005
    Messages:
    400
    Likes Received:
    3
    Trophy Points:
    168
    Location:
    New Jersey, USA
    cPanel Access Level:
    Root Administrator
    Do you want the .bash_history to be disabled so it won't record? or you just don't want them to be able to manually edit/remove it?
     
  3. mahinder

    mahinder Well-Known Member

    Joined:
    Jun 12, 2003
    Messages:
    69
    Likes Received:
    0
    Trophy Points:
    156
    Location:
    matrix
    i don't want them to be able to manually edit/remove it. I have one suspecious user who ssh on server but his .bash_history is always empty. it appears he is doing something suspicious on server but is .bash_history is always empty hence its obvious that he is removing commands from history file. I want to prevent this.

    can any one help? nick!
     
  4. txmom

    txmom Member

    Joined:
    Apr 29, 2009
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    51
    If they can't clear their history, they'll know something's up.

    Can you run a CRON job to periodically copy the file to your location?

    I must say that we want to be careful to preserve their right to privacy.
     
  5. teh

    teh Member

    Joined:
    Jul 13, 2008
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    51
    You know, there are ext2/3 file system attributes. There's the append-only flag. Read the manual pages for lsattr and chattr.
     
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice