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.

/bin/chmod permissions

Discussion in 'Security' started by cpane1, Jan 27, 2010.

  1. cpane1

    cpane1 Well-Known Member

    Joined:
    Jun 10, 2007
    Messages:
    56
    Likes Received:
    0
    Trophy Points:
    6
    Hello,

    In order to prevent hacks we tend to chmod 000 /usr/bin/wget and find...but while doing this, one of our tech ultimately chmoded the /bin/chmod to 0000.

    Please help me to recover the permissions over /bin/chmod


    Any one any solutions ?


    [root@alerts ~]# touch 1234
    [root@alerts ~]# chmod 777 1234
    -bash: /bin/chmod: Permission denied
    [root@alerts ~]# /bin/chmod 777 1234
    -bash: /bin/chmod: Permission denied
     
  2. anushkumar

    anushkumar Well-Known Member

    Joined:
    May 14, 2005
    Messages:
    51
    Likes Received:
    0
    Trophy Points:
    6
    Try Copying chmod file from another server.
     
  3. jpetersen

    jpetersen Well-Known Member

    Joined:
    Dec 31, 2006
    Messages:
    113
    Likes Received:
    4
    Trophy Points:
    18
    Code:
    [root@host ~]# cd /bin
    [root@host /bin]# cp -p ls chmod.new
    [root@host /bin]# cp chmod chmod.new
    [root@host /bin]# mv chmod.new chmod
    
     
  4. cpane1

    cpane1 Well-Known Member

    Joined:
    Jun 10, 2007
    Messages:
    56
    Likes Received:
    0
    Trophy Points:
    6
    Moving the chmod file from a different server did work, but I think that is not a great way of solving the issue, but that did worked....

    Also as jpetersen suggested worked...

    [root@alerts bin]# cp -p ls chmod.new
    [root@alerts bin]# cp chmod chmod.new
    cp: overwrite `chmod.new'? y
    [root@alerts bin]# mv chmod.new chmod
    mv: overwrite `chmod'? y
    [root@alerts bin]# ls -lah /bin/chmod
    -rwxr-xr-x 1 root root 38K Jan 28 01:40 /bin/chmod
    [root@alerts bin]#


    Thanks, issue fixed... :)
     
Loading...

Share This Page