Welcome to Centmin Mod Community
Register Now

Sysadmin Need Permissions for Root Directory

Discussion in 'System Administration' started by ljseals, Jan 18, 2017.

  1. ljseals

    ljseals Member

    88
    22
    8
    Dec 20, 2016
    Ratings:
    +42
    Local Time:
    3:44 PM
    I was not paying attention and was blindly copying and pasting into the ssh terminal and I mistakenly changed the permission on my root folders and files.

    Code:
    [root@srv1 ~]# find . -type f -exec chmod 400 {} \;
    [root@srv1 ~]# find . -type d -exec chmod 500 {} \;
    [root@srv1 ~]# find var/ -type f -exec chmod 600 {} \;
    find: ‘var/’: No such file or directory
    [root@srv1 ~]# find media/ -type f -exec chmod 600 {} \;
    find: ‘media/’: No such file or directory
    

    I only realized it when it stated that there was no such file or directory as my command to cd was not entered on login. It seems it would be a simple fix but I do not know what permissions that the files had before. It seems other folders are set at 755 and files at 644 but I do not want to do anything to mess up at this point. I pray for the Lord's help in this regard. God bless you and thanks in advance.
     
  2. ljseals

    ljseals Member

    88
    22
    8
    Dec 20, 2016
    Ratings:
    +42
    Local Time:
    3:44 PM
    I believe I may have to start over from scratch as I tried to download the files from git but they are not set up as my current system. God bless you!
     
  3. eva2000

    eva2000 Administrator Staff Member

    28,984
    6,579
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,766
    Local Time:
    6:44 AM
    Nginx 1.13.x
    MariaDB 5.5
    Indeed one of dangers of running at root. Best to do a fresh OS reload from scratch with backed up site data and restore on fresh OS install

    a tip is also cd into directory you want to run commands on and then type = pwd

    present working directory

    it outputs which directory you're current working in

    so get into habit of
    Code (Text):
    cd /directory
    pwd
    
     
    • Like Like x 1
  4. ljseals

    ljseals Member

    88
    22
    8
    Dec 20, 2016
    Ratings:
    +42
    Local Time:
    3:44 PM
    Thanks... I run it root the whole time. Is there another way around this. It actually is good that I can practice on restoration. Did I trial run from backup on my website and it took me three minutes. This will take a lot longer but I have been making notes in notepad so it is getting pretty straight forward. God bless you!
     
  5. eva2000

    eva2000 Administrator Staff Member

    28,984
    6,579
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,766
    Local Time:
    6:44 AM
    Nginx 1.13.x
    MariaDB 5.5
    practice and getting into good habits so before running any command, type pwd to double check which directory you're working in and if you remove files/directories always cd into directory you are about to remove first
     
    • Like Like x 1
  6. RB1

    RB1 Active Member

    266
    70
    28
    Nov 11, 2016
    California
    Ratings:
    +117
    Local Time:
    1:44 PM
    Nginx 1.13.x
    MariaDB 10.1.x
    I run everything as root; Danger is my middle name.
    :LOL:
     
    • Funny Funny x 1
  7. ljseals

    ljseals Member

    88
    22
    8
    Dec 20, 2016
    Ratings:
    +42
    Local Time:
    3:44 PM
    Ha ha ... well it took me about an hour an a half to finish reinstalling. Not so quick...
    Total Install Time (curl yum + cm install + zip download): 2327.0325 seconds
     
  8. RB1

    RB1 Active Member

    266
    70
    28
    Nov 11, 2016
    California
    Ratings:
    +117
    Local Time:
    1:44 PM
    Nginx 1.13.x
    MariaDB 10.1.x
    Yeah CMM and compiling PHP takes forever on my $10 Linode VPS
     
  9. ljseals

    ljseals Member

    88
    22
    8
    Dec 20, 2016
    Ratings:
    +42
    Local Time:
    3:44 PM
    Well....Uptime Robot is not too accurate still showing 100% uptime.
     

    Attached Files: