Re: Classic Gnubie accident
On Sun, Oct 29, 2006 at 01:40:39PM -0800, Jeff Goodman wrote:
> anthony wrote:
> >I'm embarrassed to admit this, but after using various flavours of
> >debian for over a year 've managed to lock myself out of my /home
> >directory. When I log in I get the message - your home directory .dmrc
> >file has the wrong permissions - permissions should be set to 664
> >(its actually the whole /home directory that has the wrong permissions)
> >I have tried logging in to a failsafe terminal and fixing this by using
> >chown username /home/anthony/.dmrc
> >the file now has these permissions:
> >-rw-rw-r-- 1 anthony anthony 26 2006-09-21 18:56 /home/anthony/.dmrc
> >but the login message is the same.
> >I am reading the debian manual on file permissions, but I don't see an
> >obvious way to reset this especially since I only have access to this
> >file as root.
> >Any help much appreciated
> Not sure if booting in single-user mode will give you root permission.
> If not, boot Knoppix, or some other live distro, mount your Debian
> partition, and do whatever tweaking is necessary.
If booting in single-user mode doesn't work, boot into a shell.
I don't know what boot loader you're using but if you
haven't pre-configured a boot option that gives you a shell,
you need to note the whole kernel boot command line,
then reboot but when you get the boot prompt (lilo, grub, whatever),
enter your kernel boot command line and add init=/bin/sh (or dash if its
At this point nothing is mounted. Check the owner/permissions of the
/home mount point and fix as needed.
Then go to /etc/rcS.d and manually start each script in the order listed
with (for example on mine):
until /home is mounted, then you can descend the /home directory and
check/fix owner/permissions until you are happy.
Then you have to manually go through /etc/rc0.d and run the scripts
starting with (on mine)
./S40umountfs start (because it the first letter is 'S')
Then power off and try a single-mode boot. If that works, try a normal