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 type "whoami" and it says "cannot find username for UID 0"... I guess I am root, but I cannot change directory to /etc to edit the passwd file... What can I do from the bash prompt?
Surely if booting toyour Linux bootloader into the bootsector of your main Linux partition, and use something rl1 (linux single) logs you in as uid 0 you will still be able to edit the file, even if the user that is associated with uid 0 doesn't exist? In which case, you might be able to fix this without having to download anyting!
Distribution: Slackware, (Non-Linux: Solaris 7,8,9; OSX; BeOS)
Posts: 1,152
Rep:
You should be able to just boot from your install disk, stop the
install w/o rebooting, mount the relevant partition (the one that
contains the /etc/ directory, either edit /mountpoint/etc/passwd
and add the user root, or copy the passwd.bak over passwd (do
you know root's passwd?). If your installation doesn't allow you
to stop the install w/o rebooting, simply hit: ALT-F2. This should
give you another console, from which you can log in as root
(the install has a user root), usually without a password. Then
go on to mount the partition.
Downloading and having tom's root boot has saved me dozens of times... I think that even if you don't use it for this particular case you should have it.
BTW... how did you manage to delete the root user... I mean.. that is something that only the root can do. Does anyone else have access to the root on that server? you should talk to that dude anyway.
Come on!!! reinstalling the entire system is a Micro$oft solution. Linux System Administrators know how to solve these kind of problems. I insist, all you need it to boot from a rescue disk and add the root account With UID and GID 0 and you'll be able to do anything. Or even boot in single-user, but if the root was properly deleted you shouldn't be ablo to log in.
Originally posted by DavidPhillips get Toms root boot and fix it by mounting the filesystem and adding root user. Because when you boot Toms root boot you will be root
You'll have to mount your root partition and chroot there before adding the user (so it will be added to your root partition /etc/passwd)
Okay, I don't mean to sound useless, but I created the boot disk from toms.net and I booted up the Linux Server. Can someone tell me how to change to my local drive so that I can change the etc/passwd file? I've been looking in books, but nothing helpful..
Thanks for any help you've given me or can give me.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.