Welcome to Centmin Mod Community
Become a Member

cannot create directory `/root'

Discussion in 'Bug Reports' started by GASTAN, Jul 23, 2018.

  1. GASTAN

    GASTAN New Member

    24
    3
    3
    Jun 28, 2017
    Ratings:
    +5
    Local Time:
    7:17 PM
    I updated centmin on weekend and I am getting followir errors when loggin in to server:

    mkdir: cannot create directory `/root': Permission denied

    where did that came from ?


    Please fill in any relevant information that applies to you:
    • CentOS Version: i.e. CentOS 6 32bit or 64bit / CentOS 7 64bit ?
    • Centmin Mod Version Installed: i.e. 123.08stable or 123.09beta01
    • Nginx Version Installed: i.e. 1.11.10
    • PHP Version Installed: i.e. 5.6.30 or 7.0.15
    • MariaDB MySQL Version Installed: i.e. 10.0.21 or 10.1.21
    • When was last time updated Centmin Mod code base ? : i.e. run centmin.sh menu option 23 submenu option 2
    • Persistent Config: Do you have any persistent config file options set in /etc/centminmod/custom_config.inc ? You can check via this command:

      cat /etc/centminmod/custom_config.inc


      Post output in CODE tags.

     
  2. eva2000

    eva2000 Administrator Staff Member

    37,258
    8,140
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,532
    Local Time:
    4:17 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    are you logging in as root user or a non-root user ?
     
  3. GASTAN

    GASTAN New Member

    24
    3
    3
    Jun 28, 2017
    Ratings:
    +5
    Local Time:
    7:17 PM
    non-root
     
  4. GASTAN

    GASTAN New Member

    24
    3
    3
    Jun 28, 2017
    Ratings:
    +5
    Local Time:
    7:17 PM
    I updated centmin today, but prob still persist

    Code:
    login as: nonrootuser
    Authenticating with public key "rsa-key-xxxxxx06"
    Last login: Mon Jul 23 13:22:26 2018 from <myip>
    mkdir: cannot create directory `/root': Permission denied
    [[email protected] ~]$
    
     
  5. eva2000

    eva2000 Administrator Staff Member

    37,258
    8,140
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,532
    Local Time:
    4:17 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    that's the problem, centmin routines usually expect root user for centmin.sh usage especially - you're running into centmin mod checking if centmin log directory exists at /root/centminlogs - all centmin.sh menu option's actions are logged to that directory. So on SSH login centmin mod checks to see if /root/centminlogs exists and if not create it but need root user to create.

    I added fix to 123.09beta01 to only try creating that log directory if root user is detected on SSH login.

    As root user, you should create the directory manually though
    Code (Text):
    mkdir -p /root/centminlogs
    
     
  6. GASTAN

    GASTAN New Member

    24
    3
    3
    Jun 28, 2017
    Ratings:
    +5
    Local Time:
    7:17 PM
    I log in as nonroot and then do sudo su -
    I assumed it's safer to not to let root to log in.
    the thing is /root/centminlogs folder exists for some time now (from installation, updates, vhosting adds)

    btw: what's the scoop with I have to change dir whne reruing centmin after udpate?
     
  7. eva2000

    eva2000 Administrator Staff Member

    37,258
    8,140
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,532
    Local Time:
    4:17 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    yeah that's because non-root user can't see /root/centminlogs.. i fixed it in 123.09beta01 update which you can update in 123.09beta01 via = cmupdate command

    updating centmin mod code only updates the code, it doesn't run any routines that are required to update existing server environment until centmin.sh is run once
     
..