Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I accidently ran sudo chown -R user:user *.* (on Ubuntu 11.1) inside /var directory..

Even after running sudo chown -R root:root *.* (and rebooting) I keep getting GUI messages that some operations are not allowed (permission errors) and even trying to run mysql, raises

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

Can this be undone?

share|improve this question

2 Answers 2

up vote 5 down vote accepted

You're going to have a headache fixing that manually. Your best bet is to restore from backup.

share|improve this answer

Not easily. /var isn't owned entirely by root. Individual bits of software own individual directories there. For example, /var/run/mysqld should be owned by the MySQL user. Your best bet is to fix these permissions as you encounter errors.

share|improve this answer
    
Don't forget the old /var/spool/mail, either. ☺ –  JdeBP Feb 12 '12 at 13:18

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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