Skip to main content

User in wheel group can't cd into public_html folders

Comments

6 comments

  • JuliusGonsalvez
    Hello, Since you have added a sudo user. Edit /etc/sudoers and add the following entry under root. sudo_user_name ALL=(ALL) NOPASSWD: ALL (add you sudo user name instead of sudo_user_name). Then login to your server and run comand :- sudo su - Do have a try.
    0
  • Optimizr
    Then login to your server and run comand :- sudo su -

    sudo su -
    just switched the user to root which I don't want because some commands are not recommended to run as root. Please see below the message when I run wp
    as root [wheel_user@server cpanel_user]$ sudo su - Last login: Sat Aug 15 03:57:49 UTC 2020 on pts/1 Last failed login: Sat Aug 15 03:58:22 UTC 2020 from 119.45.40.87 on ssh:notty There was 1 failed login attempt since the last successful login. [root@server ~]# wp Error: YIKES! It looks like you're running this as root. You probably meant to run this as the user that your WordPress installation exists under. If you REALLY mean to run this as root, we won't stop you, but just bear in mind that any code on this site will then have full control of your server, making it quite DANGEROUS. If you'd like to continue as root, please run this again, adding this flag: --allow-root If you'd like to run it as the user that this site is under, you can run the following to become the respective user: sudo -u USER -i -- wp [root@server ~]#
    0
  • cPanelLauren
    Hello, Based on what you've shown this is the standard behavior for a wheel user. It has sudo privileges and by default no one should be able to get a directory listing without either being the user which owns the file, being the root user or using sudo to escalate
    0
  • Optimizr
    or using sudo to escalate

    In fact, listing directories isn't my main goal. The main goal here is to cd into each user's directory and run commands like wp
    and composer
    but according to your reply it isn't possible without any risk except for the user account itself?
    0
  • thewarofdestinys
    The method that you have used seems to be correct. I just now tried to replicate it, and it worked just fine. I am not sure if there is a typo, but there is a slight problem with the command. There is no need to have "mygroup" mentioned in there. The following works # chmod -R g+swrx /mount/abc Even, you can remove the s bit, just do g+rwx. After you have changed the permissions, and you do ls -l, it should display the relevant privileges. 34522 silver badges77 bronze badges
    • 2 I removed the typo with the groupname. The directory has the wrx permissions on it when you do ls -l, and it is owned by nobody:mygroup. Even though myuser is part of mygroup, myuser still cannot create/delete files. I hope that makes sense.
    0
  • Optimizr
    I found out a way and I am sharing it for future visitors. As my main goal is to running the commands I mentioned without having to logout and login to different user with SSH, I use the root account to do usual tasks. When it comes to situation to use those commands that doesn't recommend running as root, I switched to the cpanel user in the same terminal by typing su - cpanelusername
    . In that way, I can run the commands as non-root and don't have to log out and login.
    0

Please sign in to leave a comment.