None of my directories are writable

0

Argh help lol

I have ran a chown command (silly me) which I did not fully understand now when I connect via filezilla and try do anything write/delete files/directories I get

Error:  mkdir /var/www/html/mysite.co.uk/directory/dsf: failure
Command:    mkdir "/var/www/html/mysite.co.uk/directory/dsf"
Error:  mkdir /var/www/html/mysite.co.uk/directory/dsf: failure

Command:    rm "/var/www/html/mysite.co.uk/backend/downloads/TallyTest.apk"
Error:  rm /var/www/html/mysite.co.uk/backend/downloads/TallyTest.apk: failure

How can I undo this damage? :(

UPDATE Command history: http://tinypic.com/r/n1fl3b/6

Kal

Posted 2013-02-08T19:40:35.463

Reputation: 115

Don't suppose you remember the syntax of the command that you ran? – EBGreen – 2013-02-08T19:47:54.637

If you don't recall, try history in your shell to see if it's in your history (assuming that you have access of course...) – nerdwaller – 2013-02-08T19:52:54.043

Ok thanks guys added a link to a screenshot of my command history. – Kal – 2013-02-08T20:06:40.013

From the command history (which does not seem to be complete), I'm guessing the problem is NOT that you "chown"'ed a file its that you "chcon"ed it - this is a key difference as chcon works with SELinux for additional restrictions. (I am not an expert here, but at least this might help you with where to look ?). Try - at least temporarily - disabling selinux and seeing if your problem goes away - then at least you know the "domain" of the problem. – davidgo – 2013-02-09T09:20:54.910

Answers

0

Well the best answer is to go to your backups and restore the damaged files.

You can use an older listing (if you have it) of the area and use that to manually return the area to the proper permissions.

Otherwise, I'll have to feel sorry for you.

mdpc

Posted 2013-02-08T19:40:35.463

Reputation: 4 176

This is the harsh way Unix teaches one not to fool around... – vonbrand – 2013-02-09T03:32:03.703

0

The link to the history just shows an empty page and a suggestion to join. I won't, sorry.

You probably messed up the execute permissions, if so a chmod -R u+X . in your home should restore execute permissions for directories (i.e., use the directory to get at the objects it points to). Check the manual page for chmod, and correct permissions of the rest one by one (or cautiously use -R).

vonbrand

Posted 2013-02-08T19:40:35.463

Reputation: 2 083