Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I think I've done drastically stupid ... I have renamed the password file for some reason. The file itself is there with a different name, so it would only be renaming it back, but I can no longer access anywhere as anybody. Would anybody kindly tell me how I could access the root directory somehow?
* Don't you have a bootable CD with a Linux Live System? Then just mount your root partition and rename it back.
* Which Boot manager do you use? I hope it's grub or LILO. Both give you the ability to pass boot parameters to the kernel.
If you use GRUB, hit Escape to get to the boot menu, select the menu entry, hit e to edit the entry.
If you use LILO, I think you have to hold Ctrl before it loads the kernel...
One of those parameters is "init=" which tells the kernel the first program it should run after it has finished initializing. Normally this is a SysV style init programm, but actually it can be anything!
Just use "init=/bin/sh" and it will start a very basic Root shell, which should be sufficient to rename the file back.
Good luck
Last edited by FnordPerfect; 01-14-2007 at 01:41 PM.
Just use "init=/bin/sh" and it will start a very basic Root shell, which should be sufficient to rename the file back.
And remember also, some distro's won't mount the / filesystem read-write when you pass init=/bin/sh or init=/bin/bash so in order to mount / which most likely has /etc, do the following:
mount /proc
mount -o remount,rw /
And then you should be able to edit your /etc/passwd file and or restore it, etc.
* Which Boot manager do you use? I hope it's grub or LILO. Both give you the ability to pass boot parameters to the kernel.
One of those parameters is "init=" which tells the kernel the first program it should run after it has finished initializing. Normally this is a SysV style init programm, but actually it can be anything!
Just use "init=/bin/sh" and it will start a very basic Root shell, which should be sufficient to rename the file back.
this got me into the system, though I found it is /root directory (rather than /) which is my original /. Couldn't initially access the directory so tried changing ro to rw. Did work then.
And remember also, some distro's won't mount the / filesystem read-write when you pass init=/bin/sh or init=/bin/bash so in order to mount / which most likely has /etc, do the following:
mount /proc
mount -o remount,rw /
And then you should be able to edit your /etc/passwd file and or restore it, etc.
and of course I forgot to read this, othrewise I could have saved a lot of time... thanx trickykid!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.