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!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

allow user to run script located in /bin

Discussion in 'General Discussion' started by tecwithquestion, Sep 8, 2017.

  1. tecwithquestion

    tecwithquestion Well-Known Member

    Joined:
    Oct 20, 2014
    Messages:
    56
    Likes Received:
    1
    Trophy Points:
    8
    cPanel Access Level:
    Root Administrator
    Hello

    I have placed my script in /usr/bin folder but when I try to run that script as user. I am getting error permission denied.

    I have set chmod u+x to file but its not working.
     
  2. SysSachin

    SysSachin Well-Known Member

    Joined:
    Aug 23, 2015
    Messages:
    562
    Likes Received:
    40
    Trophy Points:
    28
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    Please make sure that the file ownership is user:user.
     
  3. tecwithquestion

    tecwithquestion Well-Known Member

    Joined:
    Oct 20, 2014
    Messages:
    56
    Likes Received:
    1
    Trophy Points:
    8
    cPanel Access Level:
    Root Administrator
    But it will run for that user only. How can I make it available for all users ?
     
  4. SysSachin

    SysSachin Well-Known Member

    Joined:
    Aug 23, 2015
    Messages:
    562
    Likes Received:
    40
    Trophy Points:
    28
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    Are you using CloudLinux on your server? and please be more explain here about your script.
     
  5. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,127
    Likes Received:
    1,366
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    Could you provide some more information about this script and why it's added to that directory? What's it's purpose?

    Thank you.
     
  6. tecwithquestion

    tecwithquestion Well-Known Member

    Joined:
    Oct 20, 2014
    Messages:
    56
    Likes Received:
    1
    Trophy Points:
    8
    cPanel Access Level:
    Root Administrator
    Hello !

    Can I allow users to run chmod user.nobody for public_html folder
     
  7. sysdop

    sysdop Member

    Joined:
    Sep 10, 2017
    Messages:
    18
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    International
    cPanel Access Level:
    Root Administrator
    By locating the script in the "bin" or "sbin" directory you will not be able to start automatically with the system, you have to create an "init" or add a command line to crontab. With the script having permissions 7777 can be executed by any user via console regardless of everything. Hosting the script in the running public_html is a death threat.
     
  8. tecwithquestion

    tecwithquestion Well-Known Member

    Joined:
    Oct 20, 2014
    Messages:
    56
    Likes Received:
    1
    Trophy Points:
    8
    cPanel Access Level:
    Root Administrator
    Hello !

    I dont want to start it automatically.

    I just want user should be able to fix permissions at his end. Is it possible that user can set permissions for public_html at his end ?
     
  9. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,127
    Likes Received:
    1,366
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    No, attempting to update ownership to another user while logged in via SSH or FTP as the account username is not permitted. EX:

    Code:
    $ chown test123.nobody /home/test123/public_html
    chown: changing ownership of ‘/home/test123/public_html’: Operation not permitted
    You must be logged in as "root" to make this change.

    Thank you.
     
Loading...

Share This Page