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

I've just spent most of the day setting up an Ubuntu 12.10 server and I was really enjoying it. I was stupid enough to do:

sudo chmod 666 /*

instead of the equally suspect

sudo chmod 666 ./*

I can't use any programs on the system now

I havent yet set a root password so now I really wished I was on CentOS :'(

Is there anything I can do without starting again? Thanks in advance!

share|improve this question
Just for future reference, you never need to use ./*, the simple * will suffice and is less prone to misstypings. – terdon Mar 9 '13 at 13:37
Having a root user wouldn't have helped in your situation. – Sepero Mar 1 '15 at 8:21
up vote 5 down vote accepted

You have to boot from a live cd, because all your executables are not reachable in the moment (dropped access bit on directories /bin, ...).

Please do:

  1. boot from a live cd
  2. mount your system below mnt, don't forget to add additional mounts like /usr, /var, ...
  3. cd /mnt/
  4. for d in * ; do if [ -d ${d} ] ; chmod u+rwx,og+rx-w ${d}; fi
  5. chmod og= root lost+found # more restrictive permissions
  6. reboot your system and drink a beer :-)

caveat: This applies to the root directory / which normally consists only of subdirectories and symbolic links.

share|improve this answer
Thanks so much, I'm trying it now. I suppose that's such a logical solution I didn't really think of it! – Cobolt Mar 9 '13 at 13:56
@Cobolt - your welcome :-) Be happy and think what would have been happened if you also had added the -R switch to chmod ;-) – user86064 Mar 9 '13 at 13:58
Worked like a charm! Thanks. I think it's time I learnt bash scripting, php/perl doesn't make me thing sys admin enough. Thanks again! – Cobolt Mar 13 '13 at 8:02

You must log in to answer this question.

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