J
J
JunDevTest2018-07-21 05:44:52
System administration
JunDevTest, 2018-07-21 05:44:52

Chmod -R 777 / or how did I kill the system with one command?

Welcome all.
To begin with, I unfortunately did this ironically to simplify the administration of my server. Once I was wildly tired of assigning permissions 777/755 to a folder / file every time when uploading via FTP, since I had to flatter the SSH console every time. And then I thought that there must be a solution, instead of understanding how to competently differentiate rights for FTP (still don't know how :c ), I decided to get rid of the Linux rights system altogether. Without hesitation, I decided to give all files and folders in the system at once permissions 777. The command hung ... I reset it. I tried to set the rights only for home and then the first surprise, the sudo command refused. I realized that if I reboot, I won’t be able to see the working system and gave out rights 755 after waiting for the command to complete (fortunately, at that moment I was under root). Sudo started working the system rebooted and the web server began to work incorrectly. I fixed his rights... everything worked. For a few days. Then, from time to time, something began to fall off, as if the system began to self-destruct ... I ruled the law, as much as there was enough knowledge and googling. At the last moment, the Mysql database failed, the sites fell. Now I don't even know what to do.
I set up so many things there, is it possible to somehow reinstall the image but save the data (configs in etc, the home folder, etc.)?
Maybe you can turn off the rights system in Linux , I don’t fully understand how, for example, I can upload files to a folder with wget and edit via ftp. Can I somehow add an FTP user to the root group?

Answer the question

In order to leave comments, you need to log in

7 answer(s)
J
Johnny Smith, 2018-07-21
@Olek1

Hire a piece-rate devops, urgently, so as not to lose data

R
Ruslan Fedoseev, 2018-07-21
@martin74ua

hire an admin

R
Reversaidx, 2018-07-21
@Reversaidx

System rights are repaired in a couple of minutes, you install a virtual machine with the same OS, dump the rights (read getfacl), and roll out the rights.
If there are server backups, then everything is fine, just do the same from the backup

C
CityCat4, 2018-07-21
@CityCat4

Kill a penguin, don't torture your life. Many programs will simply not start when they see write permission for everyone. Many - even for a group. Sudo will definitely not run if sudoers has permissions other than 0400 (maximum 0600).
Only a backup will save the father of Russian democracy. And practice in installing a new system. You don't need to disable anything. You need to read mana, try, try and try.
If you suffer for a long time - someone will succeed (C): DD

D
Decadal, 2018-07-21
@Decadal

Assigning 777 permissions to the root is a serious mistake that requires a long recovery process (as many hosting providers support usually states). Usually admins save important data and demolish the system, or
no. Rights are one of the fundamental foundations of this operating system.

D
danSamara, 2018-07-26
@danSamara

The fundamental difference between Windows and Linux: Windows developers consider the user (even the admin) dumber than the system (I think, according to statistics, they are right), tench developers are smarter (which is probably also consistent with the statistics). Therefore, when you run commands from under the root, clearly understand what consequences will occur.
I doubt that you have configured something more complicated than Nginx+php-fpm+mail+mysql+certificates+ssh. An experienced admin will do this in half an hour, fifteen minutes of which automatic deployment scripts will work for him (or five minutes if the server is fast).
It is forbidden. Even if such a possibility existed. She bothers you because you don't know her. A properly configured system does not require constant changes of rights and works transparently, helping you to maintain the level of security at the right level.
Specifically for your access problem: read about users and groups in Linux.
According to your situation: do nothing yourself! Hire an admin who will deploy the new system and transfer the data correctly, it will not be expensive, I'm sure. Pay money and get a properly configured system and, as a bonus, a good acquaintance with devops is the right investment in your development.
For the future:

  • do not use FTP
  • read documentation
  • experiment in a virtual machine

A
asergrisa, 2018-07-21
@asergrisa

It is possible to reinstall all programs using apt-get, but this will not fix the permissions problems in the /var/lib/ folder, they will have to be adjusted manually. By the way, if you just back up this folder later, anyway, you will have to suffer with the restoration.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question