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.
|
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 ? |
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! |
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 |
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.
|
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.
|
Your title should read "I screwed up my permissions with chmod". chmod does not randomly change permissions on anything, this is user error.
|
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! |
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 |
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 |
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 |
Quote:
|
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. |
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. |
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. |
All times are GMT -5. The time now is 07:49 PM. |