0

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..

Azazel
  • 15

1 Answers1

2

Assuming you are running Linux with Grub as bootloader:

  1. Boot into Boot Linux Grub Into Single User Mode
  2. Login with the root account
  3. Execute chmod 755 /etc
  4. 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:

  1. Boot from live CD
  2. Mount the root file system of your operative UNIX system
  3. Change the permissions of /etc back to 755
  • 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
  • 1
    That 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