Koozali.org: home of the SME Server

chmod -R 0777 /home

Offline soprom

  • *
  • 589
  • +0/-0
    • www.logiciel-libre.org
chmod -R 0777 /home
« on: December 13, 2009, 05:58:07 PM »
Someone had the great idea to issue this command "chmod -R 0777 /home" and I'm looking for ways to recover from this situation.

I would save users and ibays contents, delete and recreate them with lazy-tools.
It would leave me with setting permissions manually on other folders.

Any ideas or comments?
Sophie from Montréal

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: chmod -R 0777 /home
« Reply #1 on: December 13, 2009, 06:56:54 PM »
Someone had the great idea to issue this command "chmod -R 0777 /home" and I'm looking for ways to recover from this situation.

I would save users and ibays contents, delete and recreate them with lazy-tools.

Probably not the best way to do it. Most (maybe all) permissions under /home are predictable, so you should be able to restore them to correct settings via scripting.



Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: chmod -R 0777 /home
« Reply #2 on: December 13, 2009, 07:14:20 PM »
Probably not the best way to do it. Most (maybe all) permissions under /home are predictable, so you should be able to restore them to correct settings via scripting.
For ibays this should do the trick:
Code: [Select]
signal-event ibay-modify ibayname
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 soprom

  • *
  • 589
  • +0/-0
    • www.logiciel-libre.org
Re: chmod -R 0777 /home
« Reply #3 on: December 13, 2009, 08:00:19 PM »
Thanks for your comments...

I could use:

# using e-smith to reset permissions in
# /home/e-smith/files/users and
# /home/e-smith/files/samba/profiles (?)
signal-event user-modify-admin
signal-event user-modify <each_user>
chown -R admin:admin /home/e-smith/Maildir
chmod -R 0600 /home/e-smith/Maildir


# using e-smith to reset permissions in /home/e-smith/files/ibays
signal-event group-modify <each_group>
signal-event ibay-modify <each_ibayname>
signal-event domain-modify <domain_name>

# manually reset permissions elsewhere
chown -R admin:admin  /home/e-smith/files/samba/printers
chmod -R 2775  /home/e-smith/files/samba/printers

chown -R root:admin  /home/e-smith/files/samba/netlogon
chmod -R 0644  /home/e-smith/files/samba/netlogon

chown -R root:root /home/e-smith/files/server-resources
chmod -R 0755 /home/e-smith/files/server-resources

chown -R root:root /home/e-smith/ssl.*
chmod -R 0644 /home/e-smith/ssl.*

chown -R root:root /home/e-smith/web
chmod -R 0755 /home/e-smith/web

chown -R root:root /home/httpd
chmod -R 0755 /home/httpd

# some 0640 and 0644 ?
chown -R root:admin /home/e-smith/db
chmod -R 0640 /home/e-smith/db
« Last Edit: December 13, 2009, 08:22:14 PM by soprom »
Sophie from Montréal

Offline soprom

  • *
  • 589
  • +0/-0
    • www.logiciel-libre.org
Re: chmod -R 0777 /home
« Reply #4 on: December 13, 2009, 08:12:18 PM »
Thanks, it seems to be the way to go (that, you knew!!)...

I tested with signal-event ibay-modify <ibayname> and permissions switched from 0777 to 2770, with the correct group.

Sophie from Montréal