LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-24-2010, 08:00 PM   #1
san_to_all
LQ Newbie
 
Registered: Sep 2010
Posts: 24

Rep: Reputation: 0
Accidently issued command chmod 777 /


Hi,
I have fedora 10 installed, dual boot with Vista.
I accidently issued command chmod 777 / and now linux is not loading.
I need to backup my important data. I tried accessing files from windows installing some good software but only grub partition is accessible other drive showing nothing.
 
Old 09-24-2010, 08:26 PM   #2
basheer
Member
 
Registered: Mar 2009
Location: Bangalore, India
Distribution: CentOS6.5, CentOS7, Ubuntu14.04
Posts: 182

Rep: Reputation: 29
boot from a live cd.
mount the partition.
chmod 644 /

Hope this helps.
 
Old 09-24-2010, 08:32 PM   #3
san_to_all
LQ Newbie
 
Registered: Sep 2010
Posts: 24

Original Poster
Rep: Reputation: 0
I don't have live cd.
 
Old 09-24-2010, 08:42 PM   #4
HasC
Member
 
Registered: Oct 2009
Location: South America - Paraguay
Distribution: Debian 5 - Slackware 13.1 - Arch - Some others linuxes/*BSDs through KVM and Xen
Posts: 329

Rep: Reputation: 55
Quote:
Originally Posted by san_to_all View Post
I don't have live cd.
then get one.

LQ ISO has a lot of links of good live distros.
 
Old 09-24-2010, 08:49 PM   #5
san_to_all
LQ Newbie
 
Registered: Sep 2010
Posts: 24

Original Poster
Rep: Reputation: 0
Do I need the exact destro and version of live cd? I mean Fedora10 live cd or any other live cd will do?
 
Old 09-24-2010, 11:04 PM   #6
dv502
Member
 
Registered: Sep 2006
Location: USA - NYC
Distribution: Whatever icon you see!
Posts: 642

Rep: Reputation: 57
@ san_to_all

When you ran chmod 777 /, you only affected the top level directories. If you had done something like this chmod -R 777 /, this would be even more serious.

You could do what the others have mentioned by issuing the command
chmod 644 /, but this would make all directories with those permissions.

The typical root filesystem will have different permission settings like
755, 644, etc and some folders will have additional attributes like the sticky bit -- octal value 1777 (eg. the /tmp folder)

I would do a re-install just to be safe. Make sure you backup your files and bookmarks if you don't have a separate home partition.

- Cheers

Last edited by dv502; 09-25-2010 at 12:07 AM.
 
Old 09-25-2010, 01:33 AM   #7
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Gurgaon, India
Distribution: Cent OS 6/7
Posts: 4,631

Rep: Reputation: Disabled
Quote:
Originally Posted by san_to_all View Post
Do I need the exact destro and version of live cd? I mean Fedora10 live cd or any other live cd will do?
Any live distribution should be able to help you out. Not necessarily fedora.
You still using Fedora 10? Why?
 
Old 09-25-2010, 01:46 AM   #8
Kenny_Strawn
Senior Member
 
Registered: Feb 2010
Location: /usa/ca/orange_county/lake_forest
Distribution: ArchBang, Google Android 2.1 + Motoblur (on Motortola Flipside), Google Chrome OS (on Cr-48)
Posts: 1,791
Blog Entries: 62

Rep: Reputation: 56
Yeah, Fedora 10 is almost two years old. New version please.
 
Old 09-25-2010, 04:47 AM   #9
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by basheer View Post
Hope this helps.
No, it doesn't.


Quote:
Originally Posted by HasC View Post
then get one.
Not necessary.


Quote:
Originally Posted by lqlover3074 View Post
It might be necessary.
No it isn't.


Quote:
Originally Posted by dv502 View Post
I would do a re-install just to be safe.
Not necessary either.


@san_to_all: running 'rpm -qf /' should yield "filesystem" (package name) and then 'rpm --setperms filesystem' should fix things the Red Hat way. Doing it any other way might be distro-agnostic but inconvenient, inefficient, unnecessary, dangerous or whatever else negative. (And yes, you shouldn't run F10 anymore.)





see 'man rpm', the "--setperms" switch.
 
1 members found this post helpful.
Old 09-25-2010, 04:58 AM   #10
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,128

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Cute. Must happen a fair bit then ...
 
Old 09-25-2010, 07:00 AM   #11
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by syg00 View Post
Cute.
What is "cute" are matured, supported and maintained package management systems that out of the box still do not provide certain functionality. Of course for certain groups of users dictatorships, philosophies, lore, contracts, herd instinct and whatnot have proven to be way more enticing and important arguments than say manageability and efficiency...
 
Old 09-26-2010, 12:56 AM   #12
san_to_all
LQ Newbie
 
Registered: Sep 2010
Posts: 24

Original Poster
Rep: Reputation: 0
I forgot to tell ........

Hi,
Sorry guys I forgot to tell you in detail what caused the problem.Here is the story.
I put one simple html page in /var/www/mywebdir/abc.htm just to test weather it is accessible or not. Browser showed error permission denied. then I issued command like this
chmod 777 /var/www/mywebdir/abc.htm
chmod 777 /var/www/mywebdir/
chmod 777 /var/www/
chmod 777 /var/
chmod 777 /

As soon as I issued last command, literally everything was going to its 'roots'! I mean Icons changed like windows 3.1 had, Desktop color changed black and white, and lots of other strange activities was going on. In panic I quickly issued a command chmod xxx / to restore things back(Where xxx was the figure something lower than 777 previliage which I don't remember now. I think it was 421).This does not helped me.I tried to copy my data in pendrive but it was too late.

Anyway I logged in single user mode. and issued a command chmod 644 /
but nothing seems to going right.
I tried unSpawn's suggestion rpm -qf / and rpm --setperms and the response was 'no arguments given for query'
Hopefully lots of linux services started very well.
In error messages, for me, familiar words was selinux, and
/var/log could not open log etc. and other programs showing directory /var

The reason behind using F10 is that I have very old computer with little ram. I fear more advanced destros might not install. But surely I will try to install F13. But most importand thing to me is my data. Which I had not backedup.
------------
Correction:
issuing command rpm -qf / yielded package name filesystem.
but the second command rpm --setperms <filesystem> I typed just rpm --setperms. sorry for that.

Last edited by san_to_all; 09-26-2010 at 01:24 AM.
 
Old 09-26-2010, 01:42 AM   #13
dv502
Member
 
Registered: Sep 2006
Location: USA - NYC
Distribution: Whatever icon you see!
Posts: 642

Rep: Reputation: 57
@ san_to_all

if you want to have the parent directory and it's sub directories to have the same permissions, all you need to do is add the -R option.

Example

Code:
chmod -R 777 /var/www
BTW, that is a bad permission for a web server. The permission is usually 755 -- and I see some with the permission setting of 705 like the public_html/ folder.

7 (rwx) means the owner (root) can read, write, execute a file or enter the directory.
5 (r-x) means the group user can read, execute a file or enter the directory.
5 (r-X) means everyone can read, execute a file or enter the directory.

The execute bit (--x), the octal value of 1 has two meanings:
  • A file with the execute bit means it is executable.
  • A directory with the execute bit means permission to enter the directory.

Anyway, I will stick to my original suggestion of a re-install if things becomes even more weird. Especially if this is a public internet server. You can't have messed up permissions everywhere as this could compromise your system.

Last edited by dv502; 09-26-2010 at 02:25 AM.
 
Old 09-26-2010, 02:31 AM   #14
san_to_all
LQ Newbie
 
Registered: Sep 2010
Posts: 24

Original Poster
Rep: Reputation: 0
What is the exact commond for rpm --setperms

I tried unSpawn's suggestion and issued a command
rpm -qf /
and response was filesystem-2.4.19-1.fc10.i386
and issuing commmand
rpm --setperms filesystem-2.4.19-1.fc10.i386
and response was sh: -line 1: syntax error near unexpected token ')'
sh: -line 1: '[ -L '/'] || chmod t a number) '/''

am I entering wrong command?
 
Old 09-26-2010, 03:09 AM   #15
dv502
Member
 
Registered: Sep 2006
Location: USA - NYC
Distribution: Whatever icon you see!
Posts: 642

Rep: Reputation: 57
I wish I could help you with that, but I don't know.

Wait for unSpawn to read the thread, maybe he can pin-point what you are doing wrong or if something is missing from the syntax.
 
  


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
chmod 777 and 7777 presarioch Linux - Newbie 4 06-17-2008 01:24 PM
chmod 777 664 zerocool22 Linux - Server 7 06-03-2008 06:58 AM
CHMOD in shell : chmod 777 /usr/ <---is that right? cpanelskindepot Programming 5 07-16-2004 05:37 AM
accidently set "chmod -R 777 *".. need help? scorpatron Linux - General 10 12-05-2003 03:12 AM
chmod 777 /* ziggamon Linux - Newbie 2 09-25-2003 11:40 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:16 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