0

I accidentally applied chmod 700 to the whole filesystem instead of the current directory. Non-root users now cannot run any command even though I've 777'd paths in $PATH and restarted sshd just after . I don't have a replacement Linux to copy permissions from. Is there a way out? Anybody has a chart with the default permissions for main system directories? (There is too much work to set up everything on this OS, I don't really wanna start from scratch)

  • 2
    Manually resetting permissions is probably going to be more work than setting up the system from scratch intelligently. Fortunately, for most part, you just need to dump out a package list, copy over and fix any custom config files you have, and do likewise with user directories. Ow. – Journeyman Geek Oct 3 '14 at 6:50
6

Without a source machine to copy permissions from, wether programmatically or by hand (yeah, right), you are up the virtual creek without a paddle. The best you can do is hope for a tar backup that you took and forgot about to recreate permissions from. Even copying permissions from a proper source system will likely not bring things back to perfect functionality. In a best case scenario you are looking at getting the system to a functional state which bides you time until you build a new system and migrate services and files.

           ___________    ____                                           
    ______/   \__//   \__/____\         Only YOU                    
  _/   \_/  :           //____\\                             
 /|      :  :  ..      /        \       can prevent chmod -R errors.                  
| |     ::     ::      \        /                             
| |     :|     ||     \ \______/                               
| |     ||     ||      |\  /  |                                     
 \|     ||     ||      |   / | \     
  |     ||     ||      |  / /_\ \ 
  | ___ || ___ ||      | /  /    \    
   \_-_/  \_-_/ | ____ |/__/      \     (And take backups)
                _\_--_/    \      /   
               /____             /  
              /     \           /    
              \______\_________/    
0

The easiest way to have a machine to copy permissions from would be to set up a fresh machine (on a VM, on a container) and copy from there. In the case of a container, you can easily access the container filesystem from the host, making it easier. If you are running Debian, check debootstrap.

0

check the answer here:

https://unix.stackexchange.com/questions/140193/777d-some-files-how-do-i-repair-ssh

I would advise to test first before applying to any production environments. If your issue is fixed, then please take a backup of your system

  • yhammad, links may go bad, so please synposize the solution steps at the link in your answer, and then just leave the link for reference and further research. – music2myear Oct 3 '14 at 21:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.