Welcome to Centmin Mod Community
Become a Member

Install Errors when sudoing

Discussion in 'Install & Upgrades or Pre-Install Questions' started by Liam W, Feb 17, 2016.

Tags:
  1. Liam W

    Liam W Member

    57
    16
    8
    Jun 26, 2014
    Barrow-in-Furness, Cumbria, England
    Ratings:
    +20
    Local Time:
    2:51 AM
    nginx/1.9.11
    10.1.11
    For a while I've been getting this when sudoing into an interactive shell (sudo -i):

    Code:
    [liam@torture ~]$ sudo -i
    [sudo] password for liam: 
    -bash: uname: command not found
    -bash: [: =: unary operator expected
    -bash: ls: command not found
    
    Since the PHP downgrade I just did, I'm now getting this:

    Code:
    [liam@torture ~]$ sudo -i
    [sudo] password for liam: 
    -bash: uname: command not found
    -bash: [: =: unary operator expected
    -bash: ls: command not found
    /usr/local/bin/dmotd: line 12: uname: command not found
    /usr/local/bin/dmotd: line 13: cat: command not found
    /usr/local/bin/dmotd: line 13: sed: command not found
    /usr/local/bin/dmotd: line 14: ps: command not found
    /usr/local/bin/dmotd: line 18: date: command not found
    /usr/local/bin/dmotd: line 19: [: too many arguments
    /usr/local/bin/dmotd: line 21: [: too many arguments
    /usr/local/bin/dmotd: line 28: cat: command not found
    /usr/local/bin/dmotd: line 35: cat: command not found
    /usr/local/bin/dmotd: line 36: cat: command not found
    /usr/local/bin/dmotd: line 37: cat: command not found
    /usr/local/bin/dmotd: line 41: df: command not found
    
    Is this caused by Centmin? How do I fix it?

    I'm on the .09 beta.

    Liam
     
  2. eva2000

    eva2000 Administrator Staff Member

    30,156
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,136
    Local Time:
    11:51 AM
    Nginx 1.13.x
    MariaDB 5.5
    who's your web host and virtualization environment ? centmin mod attempted to fix Amazon AWS sudo environment - see long thread by @duydangle at Wordpress - Redis cache + Opcode cache (APC/Xcache) | Centmin Mod Community and it might have affected your situation

    do you have output for these files
    • /etc/environment
    • /etc/sudoers.d/addpaths
    Centmin Mod LEMP wasn't made for sudo really, so your mileage may vary depending on how you configured sudo
     
  3. Liam W

    Liam W Member

    57
    16
    8
    Jun 26, 2014
    Barrow-in-Furness, Cumbria, England
    Ratings:
    +20
    Local Time:
    2:51 AM
    nginx/1.9.11
    10.1.11
    Hostigation, blank KVM VPS (installed centos myself from iso).

    Code:
    [root@torture public]# cat /etc/environment
    [root@torture public]# cat /etc/sudoers.d/addpaths
    Defaults secure_path = /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin
    
    Liam
     
  4. eva2000

    eva2000 Administrator Staff Member

    30,156
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,136
    Local Time:
    11:51 AM
    Nginx 1.13.x
    MariaDB 5.5
    must be an older 123.09beta01 as that line in addpaths looks like this now
    Code:
    Defaults secure_path = /usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
     
  5. Liam W

    Liam W Member

    57
    16
    8
    Jun 26, 2014
    Barrow-in-Furness, Cumbria, England
    Ratings:
    +20
    Local Time:
    2:51 AM
    nginx/1.9.11
    10.1.11
    It's not that old, I updated yesterday ;)

    I just updated. I'll run it and see if it's fixed...

    Liam
     
  6. Liam W

    Liam W Member

    57
    16
    8
    Jun 26, 2014
    Barrow-in-Furness, Cumbria, England
    Ratings:
    +20
    Local Time:
    2:51 AM
    nginx/1.9.11
    10.1.11
    I changed the line and it's fixed the errors, thanks :)

    Liam
     
    • Like Like x 1
  7. eva2000

    eva2000 Administrator Staff Member

    30,156
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,136
    Local Time:
    11:51 AM
    Nginx 1.13.x
    MariaDB 5.5
    but you setup sudo AFTER centmin mod install right ? then Centmin Mod has no chance to setup sudo it's way unless you had sudo prior to Centmin Mod install
     
  8. Liam W

    Liam W Member

    57
    16
    8
    Jun 26, 2014
    Barrow-in-Furness, Cumbria, England
    Ratings:
    +20
    Local Time:
    2:51 AM
    nginx/1.9.11
    10.1.11
    True. I installed sudo quite a while after updating to beta09... I was just using the old insecure login as root before that...
     
  9. eva2000

    eva2000 Administrator Staff Member

    30,156
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,136
    Local Time:
    11:51 AM
    Nginx 1.13.x
    MariaDB 5.5
    • Like Like x 1
  10. Inforit

    Inforit Premium Member Premium Member

    42
    13
    8
    Jul 30, 2014
    Ratings:
    +16
    Local Time:
    2:51 AM
    nginx/1.7.3
    MariaDB 5.5
    This has just happened to me after updating to 123.09beta01 from a not updated for quite some time .08, but my
    addpaths is looking correct