LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 04-04-2009, 05:16 PM   #1
ebfan1992
LQ Newbie
 
Registered: Apr 2009
Posts: 4

Rep: Reputation: 0
chmod ruined my permissions


ive been using linux for a while and i accidentally made chmod 644 to a bunch of files including some boot files making them inacsessabe by even root. i stopped it before it completly denied me permission to everything but i cant access chmod, recovery mode, or sudo and a lot of others things. they all give me "permission denied" when trying. i dont want to reinstall because i have all of my server files on this computer and i just set it up the way i want it. i can access chown and chgrp and maybe a few other files that you may suggest. im not sure if i can log in as root or maybe login at all. is there anything at all that can help? i am at the edge of pulling my hair out im so frustrated so anything at all would be extremely helpful.
 
Old 04-04-2009, 05:21 PM   #2
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,528

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
You can boot from a live cd and try to put the permissions back.,
However, since you don't know which files are changed, I would suggest to reinstall.
You don't have a backup by any chance ?
 
Old 04-04-2009, 05:30 PM   #3
ebfan1992
LQ Newbie
 
Registered: Apr 2009
Posts: 4

Original Poster
Rep: Reputation: 0
i'll download the latest livecd then try it from there. im trying to avoid reinstalling as a last resort, but if this doesnt work i'll probably have to.
thanks!
 
Old 04-04-2009, 05:44 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
The situation is most likely recoverable - what distro are you
using? Always a good idea to share that valuable piece of
information. Don't re-install just yet!



Cheers,
Tink
 
Old 04-04-2009, 06:54 PM   #5
MrChilly0
Member
 
Registered: Jan 2007
Location: midwest USA
Distribution: gentoo w/ funtoo overlay
Posts: 146

Rep: Reputation: 23
Livecd's are the way to go...made this same mistake a while back..just copied my important conf files over to a flash drive and re-installed.
 
Old 04-04-2009, 07:06 PM   #6
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671
If you also changed the permissions of directories as well, then that might be the first thing you want to fix. If the directories can't be entered, that will cause many problems.
 
Old 04-04-2009, 08:10 PM   #7
TuxSurfer
Member
 
Registered: May 2004
Location: NC USA
Distribution: Fedora 23 - Cinnamon Spin
Posts: 270

Rep: Reputation: 32
Your title should read "I screwed up my permissions with chmod". chmod does not randomly change permissions on anything, this is user error.
 
Old 04-04-2009, 09:26 PM   #8
ebfan1992
LQ Newbie
 
Registered: Apr 2009
Posts: 4

Original Poster
Rep: Reputation: 0
tuxsurfer: my mistake, i don't want to make it sound like it was the chmod's fault.
so i got the livecd working and i can mount the my harddrive. so what should i set all of my commands to? i mean, aren't i supposed to set every folder and file to 775 except for a certain home folder file? so i do chmod 775 /* ? and chmod 644 for that one file? please do correct me if i'm wrong.
thank you, your all lifesavers!
 
Old 04-04-2009, 09:32 PM   #9
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
It would help if you told us which distro you are running, and which files you changed.

Do you recall the command you used, and which directory you were in at the time?

A blanket 755 won't necessarily work as some programs are permission sensitive (ssh comes to mind), and you don't want a lot of root's and configs stuff world readable
 
Old 04-04-2009, 09:46 PM   #10
TuxSurfer
Member
 
Registered: May 2004
Location: NC USA
Distribution: Fedora 23 - Cinnamon Spin
Posts: 270

Rep: Reputation: 32
Like Tink & Billy said, it would be helpful to know the distribution you are using, also what LiveCD you are using and if possible what command you used, how you stopped the command and about how far you think it got. You may be able to open the terminal and hit the tab key a couple of times to cycle through recent commands if you don't know exactly (if you are able to log in to your desktop and open the terminal). Any info you can give us will be helpful. I didn't mean to sound like a jerk, but, words have meaning and it is a pet peeve of mine when people blame the machine. My apologies if I offended or came across a little harsh.

~TuxSurfer
 
Old 04-04-2009, 09:48 PM   #11
ebfan1992
LQ Newbie
 
Registered: Apr 2009
Posts: 4

Original Poster
Rep: Reputation: 0
oh sorry i'm using ubuntu 8.10. unfortunately i used the command in the root directory (i know i'm stupid) but i thought i was using it in /var/www/. i used 'sudo chmod /* 664'. (see i used a slash) then noticing my mistake, i did ctrl+z but the damage was already done.
edit: oh and i'm using ubuntu 8.10 for the livecd too and i am not able to log in at all (permission denied message) and i seemed to change mostly some boot permissions and most of the files in /bin/ and /usr/ and some in /etc/ and probably a lot more

Last edited by ebfan1992; 04-04-2009 at 10:14 PM.
 
Old 04-05-2009, 03:52 AM   #12
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,528

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Quote:
i am not able to log in at all (permission denied message) and i seemed to change mostly some boot permissions and most of the files in /bin/ and /usr/ and some in /etc/ and probably a lot more
I really would consider reinstall, just for safety reasons.
 
Old 04-05-2009, 04:05 AM   #13
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671
If you used "sudo chmod /*" and not "sudo chmod -R /*" then only files & directories in the root (/) directory where affected. This is because the command you indicated didn't use the recursion option. If your kernel, initrd & grub files are in grub, this probably only effected directories.

You can fix it then with:
sudo chmod u=rwx,go=rx /*
sudo chmod a=rwxt /tmp

I'm not familiar with Ubuntu's debian based package system, but I believe that it is possible to validate the permissions of the files that a package supplies. You may need to fix enough of the permissions for this to function, but it could be the final step. In your case, if you just changed the permissions of the directories, you should be OK.

Last edited by jschiwal; 04-05-2009 at 04:08 AM.
 
Old 04-09-2009, 11:17 AM   #14
canyonbreeze
LQ Newbie
 
Registered: Apr 2009
Posts: 18

Rep: Reputation: Disabled
I did a similar screwup the other day by issuing a chown -R root *.*from the root directory. Little by little I'm getting things back but there are still a lot of things that don't work. Is there a database anywhere that lists default owners, groups, permissions, et cetera for various distributions? That would be a really really really usefull tool to have. If not maybe I'll start one.

I'm on a Debian Lenny system, 2GB RAM, nVidia, AMD64. My task right now is to try to get authorizations working. I think screwed up in the /var/run directory, or somewhere.
 
Old 04-09-2009, 06:46 PM   #15
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671
I don't use a debian based system, but there may be an option similar to rpm's "rpm -qV" which would flag permission errors.

Also check your logs just after you made this change. You may have a security program which runs in the background and reports permission changes to important files.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 help and permissions pcorajr Linux - Newbie 4 02-27-2006 02:43 AM
permissions not staying using chmod after reboot dr_zayus69 Linux - Software 6 08-20-2005 03:34 AM
chmod shows change to permissions, but ls-l doesn't vdemuth Slackware 6 07-03-2004 04:29 AM
Changing permissions (chmod) teyesahr Linux - Newbie 1 07-31-2003 04:52 PM
chmod and file permissions help qages Linux - General 5 01-27-2003 06:08 AM


All times are GMT -5. The time now is 07:26 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration