i've written chmod 755 /etc/ and chmod 0644 /etc/ and now i find myself without access to anything,and inside the terminal where before there was username@system1: now there's I have no name!@system1: . I know i messed everything up,but there's a solution? a way to restore the default configuration? I Cannot reinstall,so i've to repair..
Asked
Active
Viewed 2,248 times
0
Azazel
- 15
- 5
-
If you can't login as root, boot into singe user mode and fix it, otherwise use a live cd to fix it. I guess you've locked yourself out, since the `passwd` file resides in `/etc`. – Manuel Faux Apr 05 '15 at 19:03
-
Ok,how i enter in single user mode and how i fix the mess when i'm inside the system as single user? – Azazel Apr 05 '15 at 19:07
-
First entry of a web search: [Boot Linux Grub Into Single User Mode](http://www.cyberciti.biz/faq/grub-boot-into-single-user-mode/). Even it's old it still should work. – Manuel Faux Apr 05 '15 at 19:10
-
Ok then,when i'm inside the system,what can i do to fix the mess? – Azazel Apr 05 '15 at 19:11
-
What system do you run? Linux? – Manuel Faux Apr 05 '15 at 19:16
-
Yes,debian 7 "Wheezy" – Azazel Apr 05 '15 at 19:18
1 Answers
2
Assuming you are running Linux with Grub as bootloader:
- Boot into Boot Linux Grub Into Single User Mode
- Login with the root account
- Execute
chmod 755 /etc - Reboot the system
I'm not sure if you can go beyond point 2. If it's not possible to login as root (which in fact should be, since the process which asks you for your password should have access to the /etc directory since it runs with uid 1) you need to boot from a live CD to execute step 3:
- Boot from live CD
- Mount the root file system of your operative UNIX system
- Change the permissions of
/etcback to755
Manuel Faux
- 416
- 2
- 14
-
ok...i tried to enter as root,or in single user mod but that wasn't possible(black blank screen or a black screen with the cursor in a never-ending loading) so i tried to boot with live cd and also that DIDN'T WORK. I change the boot priority(first the cd,than at the second slot the hd) but the boot go on as i never inserted any cd...i'm really afraid that i mess badly with the sysstem... – Azazel Apr 05 '15 at 19:50
-
1That you cannot boot from your CD is for sure not related with the messed permissions. – Manuel Faux Apr 05 '15 at 19:58
-
Ok,i'm an idiot...the CD reader was half unplugged. However ,having Debian live cd,where i go to mount the root file system? i'm really sorry for my lack of knowledge – Azazel Apr 05 '15 at 20:10
-
It strongly depends on your setting: Do you use LVM? Do you use mdadm? Plain partition? – Manuel Faux Apr 05 '15 at 20:11
-
I've all the file in one partition(the default configuration)...the CD i'm using is the one from which i installed Debian. – Azazel Apr 05 '15 at 20:13
-
Try `mount /dev/sda1 /mnt`. If that works, you should see the `/etc` directory of your faulty installation in `/mnt/etc`. If that does not work, maybe printing `fdisk -l /dev/sd*` might help to determine your setting. – Manuel Faux Apr 05 '15 at 20:20