LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 02-10-2008, 09:49 PM   #1
latino
Member
 
Registered: Aug 2003
Location: Puerto Rico
Distribution: Centos 6.6
Posts: 142

Rep: Reputation: 15
Unhappy how bad is this mistake?


Hi:

Well, I am having some bad days after 5 years using RHEL. by mistake (or because tired) I did a chmod 755 / (i was trying to change permisison of a htdocs directory but that went right into the server root) not happy with that I did a reboot before the command completed...

This is a RHEL 5 running selinix permissive... The big question is How bad is the mistake? I am waiting for tech at the data center to check. Probably a kernel panic or who knows...

Is advisable to re-install the OS?

TIA
 
Old 02-10-2008, 10:32 PM   #2
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
Well on every Linux I've ever seen, / itself has 755 permissions. Did you by chance do a recursive chmod to 755 (so that all files and directories in the system got chmod'ed)? That would be fairly bad since certain programs expect files to have certain permissions. Unfortunately, there's no way to undo a recursive chmod -- you have to go back and change everything back to the correct permissions by hand.
 
Old 02-11-2008, 12:20 AM   #3
Micro420
Senior Member
 
Registered: Aug 2003
Location: Berkeley, CA
Distribution: Mac OS X Leopard 10.6.2, Windows 2003 Server/Vista/7/XP/2000/NT/98, Ubuntux64, CentOS4.8/5.4
Posts: 2,986

Rep: Reputation: 45
I remember something like that happened to me while playing around in my VM, and SELinux told me to run some command that would restore the default permissions (or maybe it was to restore SELinux policies). I ran it repair mode, rebooted, and everything ran fine again.

But you have not yet rebooted, correct? Just leave the system on and wait until tech support gets back to you. In the mean time don't touch anything.
 
Old 02-11-2008, 05:49 AM   #4
latino
Member
 
Registered: Aug 2003
Location: Puerto Rico
Distribution: Centos 6.6
Posts: 142

Original Poster
Rep: Reputation: 15
Unhappy

Well, that is the worst mistake I have ever done in a Linux setup. I have asked for an OS RELOAD. Since I upgraded from RHEL 4 days back it is better to be sure the server is ok, than having issues as data and programming work is done.

So the MISTAKE is REALLY bad, a learning be aware (of root dir) when changing permissions!!

Later
 
Old 02-11-2008, 06:05 AM   #5
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
For next time remember that next to other things RPM also supports restoring permissions. One way is to use "--setperms", the other way is by extracting information from the RPMDB:
Code:
 
#!/bin/bash
# Purpose: Restore filesystem permissions from RPM database
# Args: none or package name
# Deps: Bash, GNU utils, rpm
case "$#" in
0) echo "Dump for ALL packages [N|y]?"; read ans; case "${ans:0:1}" 
   in y|Y) rpmopt="a"; unset pkg;; *) exit 1;; esac;;
*) unset rpmopt; pkg="$1";;
esac
rpm -q${rpmopt} --dump ${pkg}|while read t; do
        t=( ${t} ); for i in 3 4; do
        case "${#t[$i]}" in 7)
                echo "chmod ${t[$i]:3:4} ${t[0]}"
                echo "chown ${t[5]}.${t[6]} ${t[0]}";;
        esac; done
done
exit 0
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
mount: wrong fs type, bad option, bad superblock on /dev/cdrom, Adil_uk Linux - Hardware 9 02-16-2005 05:50 PM
Big stupid Bad Mistake... GRUB dasz Linux - Software 7 12-09-2004 09:35 AM
bad mistake cxtech Linux - Newbie 3 03-01-2004 08:39 PM
mount: wrong fs type, bad option, bad superblock on /dev/sdb1 pmoreira Linux - Hardware 5 02-26-2004 10:31 AM
grub-install /dev/hda1 = bad mistake? raedt Linux - General 4 08-17-2003 03:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 05:08 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration