Chmod-R 777 / or how I killed my system with one command?

Greetings to all.
Start with the fact that I unfortunately did it ironically, to simplify the administration of your server. One day I got tired of every time to register the folder/file rights 777/755 when you fill via FTP, as it was necessary each time the flattery in the SSH console. And here I thought that there has to be a solution rather than understand how to differentiate the rights for FTP ( still don't know how :c ), I decided to get rid of the permissions system Linux. Without hesitation, I decided to give at once all files and folders in the system, permissions 777. The team is stuck... I resitol. I tried to ask only for the right home and then the first surprise, refused the command sudo. I realized that if I reboot a production system, I can't see and given the right 755 are already waiting for completion of the command ( fortunately, this time was under root ). Sudo started to work, the system rebooted and the web server began to work correctly. I fixed him the right... it worked. A couple of days. Then sometimes things start to fall off, as if the system began to self-destruct... I rules of law, so, as far as knowledge and gugleniya. At the last moment refused Mysql database, sites fell. Now I don't even know how to be.

I have so much there set up, is there a way to reinstall the image but keep the data ( configs in etc, home folder etc )?
Maybe you can disable the system in Linux, I do not fully understand how I, for example, to upload files to a folder wget'ohms and edit via ftp. I can somehow user FTP add in root group?
June 3rd 19 at 19:01
7 answers
June 3rd 19 at 19:03
Hire a piece of devops, urgently, to avoid losing data
Hire. A couple of muffins or a cool beer =) - arlie_Beck commented on June 3rd 19 at 19:06
on freelancin or upwork - Linnie_Shanahan commented on June 3rd 19 at 19:09
, your hardware or the cloud? If its the city? (by ssh or you can live to drive), the direction of activities? (for decision on free care) is actually a lot of questions, but to help for free in this situation can, training or further support - only contract. - Gillian_Trantow commented on June 3rd 19 at 19:12
Wow... apwork all greens ask, but I'm still learning to work with Linux)

VPS in DC, somewhere in the wild West, I doubt that will be able to live on such a contract even the two kidneys are not enough :( Learn how to work with Linux and want to create a non-commercial Highload web-project in the future ( more precisely, we can say that development has already started, but freeze due to the loss of work for some time ). Well, I want to create my Naranco, but not yet decided. Something like that) - arlie_Beck commented on June 3rd 19 at 19:15
In what then sense of the sacred in system restore, if it is a "student project"?
Well, okay. Under such starting conditions, unless there are special traffic restrictions, I can (to get a list of valuable installed software, necessary to salvation) valuable to take out, reinstall and put back, passing to set up the ftp (the configuration issue).
Username/password and the entry point for ssh, as well as the list of requirements in the PM.
Will see that an active commercial project - from topic will move out, or ask for money. - Gillian_Trantow commented on June 3rd 19 at 19:18
Well or the second variant: it's you, I plugged in and working so that you see, but it may be slower. - Gillian_Trantow commented on June 3rd 19 at 19:21
,
Wow... apwork all greens ask, but I'm still learning to work with Linux)

Then freelancin ru or flru - Linnie_Shanahan commented on June 3rd 19 at 19:24
June 3rd 19 at 19:05
hire admin
Hire. A couple of muffins or a cool beer =) - arlie_Beck commented on June 3rd 19 at 19:08
Yes, easily. the cost of a cool beer in our village voice? ;) - Linnie_Shanahan commented on June 3rd 19 at 19:11
This village is not the case Fredrikstad?) - Gillian_Trantow commented on June 3rd 19 at 19:14
no, a little closer would be.

But seriously - crap recovery now much. RPM-based system a little easier to restore your rights, it is important to achieve work rpm ;)
I on your place would zabekapit website\sites copied the mysql directory, and reinstalled.
And put some thread bar yourself, everything is easier to organize the work of a novice would be.... - arlie_Beck commented on June 3rd 19 at 19:17
,
I on your place would zabekapit website\sites copied the mysql directory, and reinstalled.
And put some thread bar yourself, everything is easier to organize the work of a novice would be....


That "mess" then Linux users)) open rule - Gillian_Trantow commented on June 3rd 19 at 19:20
Nuuuuu , from under root to kill system - not a big feat. I and server Windows can put and tench. If you are working under root or its rights, it is first necessary to perform the famous command: root@vpupkin# cat /dev/ass > /dev/head - Gillian_Trantow commented on June 3rd 19 at 19:23
I still don't get it, why after changing the permissions to all files to be reinstalled, but can't exactly back to change them in the reverse order as in normal Windows? - Linnie_Shanahan commented on June 3rd 19 at 19:26
. And below the comments where it was about it. For example . In the discussion indicated the complexity of this process.
In defense of Windows, I can say that even the built-in admin can't (well, let's just say in one sitting) to demolish ALL right. But after persistent woodpecker finally gets its way, there is a good chance that over time Windows will be covered. As was the case in the TC, only with Lin. By the way, Lin is still complicated by the fact that if the process above is required, it may simply not start.
After experimenting with rights there are two ways: methodically all rights to recover from the benchmark. Or zabekapit all important re-roll. Each for himself chooses his own path.

Well, +5 COP: we will have at leisure to try on the virtual reality and carry all the rights to Windows and Lena, and see who will die and how complex the process of demolition in each system. - arlie_Beck commented on June 3rd 19 at 19:29
had another to put the question, and Windows is this nonsense even initially they do? - Reb commented on June 3rd 19 at 19:32
The methodology is different. If you need to register on line 777 from under Ruta, in the case of Windows it is necessary to change owner to myself, well, for example.
Answer: Yes, it will. GUI tools in complex cases, the commands TakeOwn and CALCS.

UPD: If You in system admin. - arlie_Beck commented on June 3rd 19 at 19:35
And what's to stop her? Become the owner with the spread of the subdirectories, replace the right with the spread of subdirectories. Another thing is that to run programs right in Windows special Grand piano do not play (except for a small list of files and directories that Windows knows by name), and having demolished all the rights in the root of Linux for it and have unimaginable problems, because in many working directories in /var, in a variety of directories at the root, /usr and the subdirectories are separate programs with setuid, setgid, sticky bit directories, directories with cleverly placed denied 0700 etc. The system relies on the fact that the rights are placed need . With all the influx dobolyi Linux last time, still basically Linux on dobolyi not calculated. A Windows - designed. Different classes of tasks and different tools. - Reb commented on June 3rd 19 at 19:38
I have is a well-known socket, as long as it works, in some places even the right to have polystable. Have deinstallirovat PHP/MySQL and some other packages. Everything works... for now. But maybe it's going to carry, just something that you probably only takes a minute, it would take me a lot of time and it is not so much on this( - Linnie_Shanahan commented on June 3rd 19 at 19:41
so, you want to learn or problem to solve? To solve the problem - welcome the PM. To learn - there is already said a lot of things, read not read - Gillian_Trantow commented on June 3rd 19 at 19:44
June 3rd 19 at 19:07
System permissions stalling for a couple of minutes, put dev with takoyzhe OS, dampish rights(read getfacl commands), and ... unroll law.
If there is a backup server that in General everything is fine, just do the same thing with the backup
so he in addition to the basic rights system will have to deal with ACL :) - arlie_Beck commented on June 3rd 19 at 19:10
June 3rd 19 at 19:09
Kill the penguin, don't hurt zivotne. Many programs simply will not start seeing a resolution on the record for everyone. Many - even for the group. Sudo just will not run if the sudoers will have rights different from 0400 (max 0600).
Only a backup will save the father of Russian democracy. And practice in the installation of the new system. No need to disable it. You need to read mana, try, try and try.

If you long to suffer - anyone get (C) :DD
Kill the penguin, don't hurt zivotne.


I'm under the table =))
This five! - arlie_Beck commented on June 3rd 19 at 19:12
the biggest problem will be in the 4th category (older) - SUID, SGID, Sticky - Linnie_Shanahan commented on June 3rd 19 at 19:15
Agree. They are usually placed rare piece, but the uninstallation. fraught with difficult to understand problems. - Gillian_Trantow commented on June 3rd 19 at 19:18
June 3rd 19 at 19:11
Assign the rights 777 on the root this is a serious error that requires a long recovery process (which usually declares support many hosting providers). Usually admins keep important data and take down the system, or
readhow to restore your rights with a different, correctly configured system.
Maybe you can disable the permissions system in Linux

no. Right - one of the fundamentals of the operating system.
this is what such service providers accept "Assignment of the rights 777 on the root" ? - arlie_Beck commented on June 3rd 19 at 19:14
the service is called "rent a server". I think it would not make sense to rent a server if provider is something forbidden there to do - Linnie_Shanahan commented on June 3rd 19 at 19:17
Any VPS. There you have a server, we want to have him :) If something went wrong you can always reinstall :) - Gillian_Trantow commented on June 3rd 19 at 19:20
June 3rd 19 at 19:13
The fundamental difference between Windows and Linux: developers believe Windows is the user (even admin) stupid system (I think, statistically, they are right), the developers of Lin - smarter (which is probably also consistent with statistics). So when you run the command from under the root, clearly understand what the consequences will happen.

I have so much there set up, is there a way to reinstall the image but keep the data ( configs in etc, home folder etc )?

I doubt that you have configured something harder than Nginx+php-fpm+mail+mysql+certificates+ssh. An experienced admin will do it for half an hour, fifteen minutes of which he will have to work automatic deployment scripts (or five minutes if the server is smart).

Maybe you can disable the system in Linux, I do not fully understand how I, for example, to upload files to a folder wget'ohms and edit via ftp. I can somehow user FTP add in root group?

Impossible. Even if such a possibility existed. It bothers you because you don't know her. A properly configured system does not require constant change and operates transparently, helping you to maintain the level of security at the proper level.
Specifically, your problem with the access: read about users and groups in Linux.
For your situation: don't do anything yourself! Hire an administrator, who will deploy the new system and will transfer information correctly, it won't be expensive, I'm sure. Pay money and get a properly configured system, and a bonus, a good introduction to devops is the right investment in your development.

For the future:
  • do not use FTP
  • read the documentation
  • experiment on a virtual machine
June 3rd 19 at 19:15
You can reinstall all of the programs using apt-get, but it will not fix a permission problem in the folder /var/lib/ then you have to configure manually. By the way if you just subcapital this folder then, you still will have a lot of trouble with recovering.

Find more questions by tags UbuntuSystem administration