Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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/ failure
Command:    mkdir "/var/www/html/"
Error:  mkdir /var/www/html/ failure

Command:    rm "/var/www/html/"
Error:  rm /var/www/html/ failure

How can I undo this damage? :(

UPDATE Command history:

share|improve this question
Don't suppose you remember the syntax of the command that you ran? – EBGreen Feb 8 '13 at 19:47
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 Feb 8 '13 at 19:52
Ok thanks guys added a link to a screenshot of my command history. – Kal Feb 8 '13 at 20:06
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 Feb 9 '13 at 9:20

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.

share|improve this answer
This is the harsh way Unix teaches one not to fool around... – vonbrand Feb 9 '13 at 3:32

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).

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .