Welcome to Centmin Mod Community
Become a Member

Sysadmin How do you create a Sudo SuperUser on Centmin Mod

Discussion in 'System Administration' started by ljseals, Apr 29, 2017.

  1. ljseals

    ljseals Member

    101
    24
    18
    Dec 20, 2016
    Ratings:
    +46
    Local Time:
    6:07 AM
    I am looking to create a sudo superuser for a webapp that I am trying to adapt to Centmin but I am having a few problems. I have tried to create using the script
    Code (Text):
    tools/addsudousers.sh desiredusername
    



    I was able to create a user and a password but I was not able to set it to a super user. I set this code.
    Code (Text):
    # Gpasswd -a user wheel
    but it did not work as expected. So I tried
    Code (Text):
    visudo
    
    ## Allow root to run any commands anywhere
    root ALL=(ALL) ALL
    user ALL=(ALL) ALL


    but I was not even allowed to change the directory with the sudu user account. The webapp is NextERP GitHub - frappe/bench: Multi-tenant platform to manage Frappe / ERPNext. I have not been able to install it because it needs a sudu user to install frappe which is needed to install the program. I know that Centmin is based on Root user but I am wondering if this would be a problem. God bless you!
     
    Last edited: Apr 29, 2017
  2. ljseals

    ljseals Member

    101
    24
    18
    Dec 20, 2016
    Ratings:
    +46
    Local Time:
    6:07 AM
    No worries... I see your post @eva2000 https://community.centminmod.com/posts/39469/
    cd command is not an executable but a shell function and cmdir is an alias is not available to logged in sudo user but you can manually add support for cmdir at least - add this into your sudo user's /home/sudousername/.bash_profile file add to end of file

    Code (Text):
    alias cmdir='pushd /usr/local/src/centminmod'



    then log out of sudo ssh user session and log back in then cmdir shoudl work as sudo user logged in, but you still need to switch from sudo to full root user to run centmin.sh itself as it's owned by root user.

    Same with cd /home/nginx need to switch to full root user via sudo
     
  3. eva2000

    eva2000 Administrator Staff Member

    55,223
    12,253
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,831
    Local Time:
    9:07 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    tools/addsudousers.sh is correct and easy way to add sudo users and yes shell aliases would need to be done manually as https://community.centminmod.com/threads/dmotd-permission-denied-sudo-users.9220/page-2#post-39469

    edit: just added cmdir alias to tools/addsudousers.sh creation routine so at least that is taken care of

    Unfortunately, root user will always be needed to manage Centmin Mod tasks :)
     
    Last edited: Apr 29, 2017