Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's 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.
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900
Rep:
Boot from Ubuntu CD. Mount your installed system. Run 'chroot /mnt/installed' (or whatever it is called). Run 'man useradd', read the key name to set uid to 0 (or everything will be more difficult; if you still make a mistake - usermod will help), and run useradd with needed options.
Check if you are missing entries for root in /etc/passwd and /etc/shadow.
Adding these lines may help if they aren't present. Edit the files offline using a rescue disk or live distro. Then if you can reboot, into single mode, make sure you run "passwd" to give the root user a password.
You did not delete the root account. Its still there, but on Ubuntu, the root account is locked i.e. has no password. Just do "sudo passwd root" to give root a password and you should be able to login to the root account.
You did not delete the root account. Its still there, but on Ubuntu, the root account is locked i.e. has no password. Just do "sudo passwd root" to give root a password and you should be able to login to the root account.
Code:
[06:42:19][dv5000t>~]$ sudo passwd root
sudo: no passwd entry for root!
Quote:
Check if you are missing entries for root in /etc/passwd and /etc/shadow.
Adding these lines may help if they aren't present. Edit the files offline using a rescue disk or live distro. Then if you can reboot, into single mode, make sure you run "passwd" to give the root user a password.
This is why I asked the previous question. I booted from the ubuntu live cd, (on the install cd there is a livve cd of ubuntu too), and I opened up a terminal, opened up /etc/passwd, and it was nothing like the file that I have when I don't use a live cd.
I will try a slackware install cd I have lying around, and say how that goes.
I thought that you couldn't use sudo anymore. You can only edit /etc/password as root. In the live distro, mount your old root partition somewhere. You said it was /dev/hda3.
If you are using the ext3 filesystem then
mount -t ext3 /dev/hda3 /mnt/
will mount it under /mnt.
If you are using a rescue disk, it may not have vim but instead vim-minimal.
You need to check if the root entries exist in /etc/passwd and /etc/shadow.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.