Koozali.org: home of the SME Server

I have done a "chmod-R 777 /" !!!!!!

Offline milaweb

  • **
  • 25
  • +0/-0
    • http://www.milasupport.dk
I have done a "chmod-R 777 /" !!!!!!
« on: March 23, 2009, 10:53:52 AM »
Hi there

I know I am a huge idiot!
Do i have any chance getting back or is it a reinstallation?
I can't get acces via console.....

/Michael

Offline Tib

  • *
  • 571
  • +0/-0
    • http://www.tibors.net
Re: I have done a "chmod-R 777 /" !!!!!!
« Reply #1 on: March 23, 2009, 11:27:29 AM »
Maybe a little more info would be good here ....

What have you done a chmod-R 777 on ?

When you say "I can't get acces via console..... " so you mean the putty console or you can't access your server through the monitor connected to your SME box?

As I mentioned ... I bit more info would be helpful before ppl can comment.

Regards,

Tib

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: I have done a "chmod-R 777 /" !!!!!!
« Reply #2 on: March 23, 2009, 11:56:05 AM »
Maybe a little more info would be good here ....

What have you done a chmod-R 777 on ?
See the subject line... the whole tree.

milaweb, unfortunately there is no easy way back from this, I hop you have a recent backup handy as AFAIK a reinstall is the only way to restore your system.

Next time please do not chmod files, this is hardly ever necessary on SME Server as long as you set the proper ownership and permissions through server-manager and is most of the time done on ill information found on the net not geared to SME Server or by people unaware of the architecture of SME Server. Altough SME Server is a linux machine, it is not a normal linux machine as the server-manager is considered the primary configuration interface and the SME Server CLI is hardly needed in normal administration. To facilitate some major changes and enhancements have been made compared to normal linux systems on which you can read in the SME Server Devlopers Guide linked in the wiki, esepcially the section on the internal configuration database in combination with the template system for generating configuration files is a must read.
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline Tib

  • *
  • 571
  • +0/-0
    • http://www.tibors.net
Re: I have done a "chmod-R 777 /" !!!!!!
« Reply #3 on: March 23, 2009, 12:00:48 PM »
oops ... my mistake ... missed the "/"


Offline milaweb

  • **
  • 25
  • +0/-0
    • http://www.milasupport.dk
Re: I have done a "chmod-R 777 /" !!!!!!
« Reply #4 on: March 23, 2009, 12:12:07 PM »
Fortunately, I have a good backup. I actually just wanted to make a config-file, to a cms, writeable. And it was!

I learn something all the time. I will reinstall tonight...

Thanks for your reply....

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: I have done a "chmod-R 777 /" !!!!!!
« Reply #5 on: March 23, 2009, 12:36:38 PM »
Fortunately, I have a good backup. I actually just wanted to make a config-file, to a cms, writeable. And it was!
If it was only one file why the heck did you add the -R switch (as this is for recursive) and will, as you already noticed, apply to the whole subtree from the point you specify.
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline Tib

  • *
  • 571
  • +0/-0
    • http://www.tibors.net
Re: I have done a "chmod-R 777 /" !!!!!!
« Reply #6 on: March 23, 2009, 12:43:16 PM »
Actually this brings me back to a post I did on a diff thread.

You should not get into the habit of installing from "/" ... too many things can go wrong too easily.

Should always install from a diff/specific dir setup for installations.

Regards,

Tib

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: I have done a "chmod-R 777 /" !!!!!!
« Reply #7 on: March 23, 2009, 05:51:44 PM »
If you'd done "chmod-R" you would have been OK - it would have just been a "command not found" error.

*Never* set permissions to 777. It's always the wrong thing to do.

I can't get acces via console.....

If you boot single user, there is a small chance that you could repair things by doing:

rpm --setugids $(rpm -qa)
rpm --setperms $(rpm -qa)
signal-event post-upgrade ; signal-event reboot

Offline Stefano

  • *
  • 10,894
  • +3/-0
Re: I have done a "chmod-R 777 /" !!!!!!
« Reply #8 on: March 23, 2009, 05:58:48 PM »
rpm --setugids $(rpm -qa)
rpm --setperms $(rpm -qa)
signal-event post-upgrade ; signal-event reboot

will they work or not, these 3 lines are a good reason to love linux..

grazie
Ciao
Stefano

Offline milaweb

  • **
  • 25
  • +0/-0
    • http://www.milasupport.dk
Re: I have done a "chmod-R 777 /" !!!!!!
« Reply #9 on: March 23, 2009, 06:04:49 PM »
Thanks everyone!

I am back in business.
I did a reinstall, and restore from DAR2(i love it!).

I have also installed a test-setup now!

Offline Normando

  • *
  • 841
  • +2/-1
    • Unixlan
Re: I have done a "chmod-R 777 /" !!!!!!
« Reply #10 on: March 24, 2009, 07:19:34 AM »
rpm --setugids $(rpm -qa)
rpm --setperms $(rpm -qa)
signal-event post-upgrade ; signal-event reboot

BRILLIANT

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: I have done a "chmod-R 777 /" !!!!!!
« Reply #11 on: March 24, 2009, 02:09:13 PM »
BRILLIANT
h

Don't get too excited. That process won't restore all permissions. For instance, it won't tighten necessary permissions on home directory files and directories or within /tmp, and maybe not on i-bays either. Perhaps those issues could be dealt with by adding an action during, say, bootstrap-console-save, but at the cost of much slower execution time.

Let's call it the start of a recovery process, but only the start.