Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

root password is unrecognised

Ask for help with issues regarding the Installations of the Debian O/S.
Post Reply
Message
Author
samhain
Posts: 9
Joined: 2017-04-15 17:09

root password is unrecognised

#1 Post by samhain »

I have just installed debian 8.7.1.

I can boot and log in and everything seems okay except...
The root password that I set during the install procedure is not recognised when I try to authenticate for an action that requires it.

I am certain that I am typing it correctly, caps lock is not on etc.

I would appreciate any ideas how to resolve this.

User avatar
golinux
Posts: 1579
Joined: 2010-12-09 00:56
Location: not a 'buntard!
Been thanked: 1 time

Re: root password is unrecognised

#2 Post by golinux »

This has always worked for me. Does root PW work otherwise?
May the FORK be with you!

peter_irich
Posts: 1403
Joined: 2009-09-10 20:15
Location: Saint-Petersburg, Russian Federation
Been thanked: 11 times

Re: root password is unrecognised

#3 Post by peter_irich »

There are many methods. It also depends from that whether or not you have Live CD or can you or not boot in single mode without password.
1st try in google
how to reset root password in Linux

Peter.

samhain
Posts: 9
Joined: 2017-04-15 17:09

Re: root password is unrecognised

#4 Post by samhain »

The password reset instructions in the link above do not seem to apply here. I press 'e', then I get a screen headed 'Set params Debian GNU/Linux". Under that is what I take to be the grub parameters, or a script anyway. If I cursor down a few lines and press 'e' again it just echos 'e' to the screen.
At the bottom of the screen there is advice to press Ctrl-c or F2 for a command line, but that gives me:
grub>
Which doesn't look like what I need

I forgive you for suspecting so, because I probably would too, but I don't see this as a forgotten or mistyped password issue. I know this password well. There is a Debian v7 install on another disk on the same machine and I am using the same root password as that has. Also, let me say that, this exact issue happened before about a year ago. At that time I did the installation over several times assuming I had made a mistake. But I hadn't. In the end I gave up and installed Debian 7 again because that was known to work.

I seem to recall reading somewhere that if one doesn't enter a root password in installation, the user will be set as a sudoer instead? Is that true? Should I just try that and see what happens.

samhain
Posts: 9
Joined: 2017-04-15 17:09

Re: root password is unrecognised

#5 Post by samhain »

I do have a live DVD, that's what I installed from.
Can I use that some way?

User avatar
debiman
Posts: 3063
Joined: 2013-03-12 07:18

Re: root password is unrecognised

#6 Post by debiman »

root password or user password?

su = root password
sudo = user password.

it is possible to set a root passwd like this:
sudo su <--- enter user password here!
passwd root <--- enter desired root password!

samhain
Posts: 9
Joined: 2017-04-15 17:09

Re: root password is unrecognised

#7 Post by samhain »

it is possible to set a root passwd like this:
sudo su <--- enter user password here!
passwd root <--- enter desired root password!
But this is a new installation and the user account is not in sudoers by default, so I can't do that.

samhain
Posts: 9
Joined: 2017-04-15 17:09

Re: root password is unrecognised

#8 Post by samhain »

This has always worked for me. Does root PW work otherwise?
I did try the instructions given there but I suspect they may be for a different version of grub or something, anyway, what those instructions describe does not happen when I try them. The instructions say:

Boot to the grub menu. Then press <e> (for edit) before Linux has a chance to boot
Using your keyboard arrow keys, move the cursor down a line or so, and press <e> (for edit) again. You should now be on the Kernel line,

When I do that the first <e> shows a page headed "set params" with about a dozen lines of commands below, and when pressed, the second <e> just echos to the screen. What is meant by the 'Kernel line' in this instruction? Is it one of the lines of commands I am seeing?

No, root password does not work at all.

User avatar
GarryRicketson
Posts: 5644
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: root password is unrecognised

#9 Post by GarryRicketson »

You are NOT editing the parameters, script,...like the instructions tell you

by samhain »I press 'e', then I get a screen headed 'Set params Debian GNU/Linux".Under that is what I take to be the grub parameters, or a script anyway. If I cursor down a few lines and press 'e' again it just echos 'e' to the screen.
Try reading the instructions more carefully,
you must find the line that is the "kernel line", it is pretty obvious be cause
it is the only line in the script mentioning the kernel, then you edit it, adding,
(appending) the "init=/bin/bash/code",...


Select the appropriate boot entry in the GRUB menu and press e to edit the line.
Select the kernel line and press e again to edit it.
Append

Code: Select all

 init=/bin/bash
at the end of line.
Press Ctrl-X to boot (this change is only temporary and will not be saved to your menu.lst). After booting you will be at the bash prompt.
Your root file system is mounted as readonly now, so remount it as read/write

Code: Select all

 mount -n -o remount,rw /.
Use the

Code: Select all

 passwd 
command to create a new root password.
Reboot by typing reboot -f and do not lose your password again!
Note, I do not have UEFI,and never will, but I saw a note on that:
If you have a UEFI system it's the line that starts with linuxefi
So I don't know on that, maybe some of the UEFI users do.

And yes you can also do this using a live CD, there are many instructions
in the search results on that as well.
There are various ways to do this, if one does not work , try another.

I found this, you still need some minimal reading skills, but it is mostly pictures ,
Scroll down to method 2 "without root password"
http://www.wikihow.com/Change-the-Root- ... d-in-Linux

==== note =====
y samhain » I did try the instructions given there but I suspect they may be for a different version of grub or something,
Well, then you need to tell us what version of grub you are using, you should have done that to start with, What makes you suspect this ? did you install a different version ?
I suspect the "or something", is something you have done , but are not telling us,
Is this really your computer ?
:mrgreen:
====== If all else fails =========
The above method, editing the grub, has worked for me as well, but if nothing else works, you could just re-install, and this time be sure you get the root password right, maybe even write it down on a piece of paper, or something,
keep it in you wallet,...
Last edited by GarryRicketson on 2017-04-15 20:34, edited 2 times in total.

samhain
Posts: 9
Joined: 2017-04-15 17:09

Re: root password is unrecognised

#10 Post by samhain »

Well, then you need to tell us what version of grub you are using, you should have done that to start with, What makes you suspect this ? did you install a different version ?
I suspect the "or something", is something you have done , but are not telling us,
Is this really your computer ?
I will check the version of grub when I go reboot in a minute, it is whatever version is installed from the 8.7.1 live CD. What made me suspect was that those instructions, when followed, to the letter, did not produce the result that they lead me to expect. :D
I will try again using your helpful advice.

samhain
Posts: 9
Joined: 2017-04-15 17:09

Re: root password is unrecognised

#11 Post by samhain »

Well, then you need to tell us what version of grub you are using, you should have done that to start with, What makes you suspect this ? did you install a different version ?
I suspect the "or something", is something you have done , but are not telling us,
Is this really your computer ?
@GarryRicketson Thank you for the wikihow page and your hints. The instructions there turned out to be applicable. The first ones I tried were different and were not applicable to my version of grub.

I have been through the reset procedure, and set the original password again, everything went as expected.

It hasn't helped though. After logging in as the regular user, attempts to authenticate with the root password are still rejected, just as before. TBH I expected that.

The version of grub appears to be: 2.02~beta2-22 FWIW. Anyway that problem is solved.

"or something" is just my sloppy way of saying that I'm guessing and that I have been known to be wrong.

Yes it is my computer :D . Sadly. Right now I kind of wish it wasn't.

If nobody has any other ideas I will try reinstalling and not providing a root password at all, in the hope that this will set up the user account as a sudoer. Assuming that isn't an urban legend. I will report back.

(As I wrote above, the last time this occurred I tried reinstalling several times on the assumption that I had set the root password incorrectly during installation - and being very careful obviously - but that made absolutely no difference. So I do not believe that's an option. And it's why I didn't really expect resetting the password to work either.)

It's a b*tch having an "impossible" issue.

User avatar
GarryRicketson
Posts: 5644
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: root password is unrecognised

#12 Post by GarryRicketson »

Wait a minuet, or more, don't try re-installing just yet.
by samhain » I have been through the reset procedure, and set the original password again, everything went as expected.

It hasn't helped though. After logging in as the regular user, attempts to authenticate with the root password are still rejected, just as before.
Can you give us more details, on what it is that is asking to authenticate with
the root pass word,... ?
At the terminal, if you type "su", you then need to enter the root password,
Yes it is my computer :D . Sadly. Right now I kind of wish it wasn't.
Ok, any way I was just kidding ....
If nobody has any other ideas I will try reinstalling and not providing a root password at all, in the hope that this will set up the user account as a sudoer. Assuming that isn't an urban legend. I will report back.

(As I wrote above, the last time this occurred I tried reinstalling several times on the assumption that I had set the root password incorrectly during installation - and being very careful obviously - but that made absolutely no difference. So I do not believe that's an option. And it's why I didn't really expect resetting the password to work either.)
I don't think that is a very good idea,, I have never tried that (not providing a root password), but I have seen some threads here where that leads to some problems.
Since you have tried several times, using this particular image,:
I have just installed debian 8.7.1.
Which actually it is not clear, What image (ISO) did you use,..? Trying it again
may just be a waste of time, all though not very likely, it is possible something
is wrong with the installer, and it is not receiving and setting the root password correctly,... another possible "or something",... I think I would try downloading
a different image, and makeing a new install media,... you also don't tell us about that, is it a USB device or CD, .. ? etc.
Last edited by GarryRicketson on 2017-04-15 22:42, edited 1 time in total.

User avatar
dasein
Posts: 7680
Joined: 2011-03-04 01:06
Location: Terra Incantationum

Re: root password is unrecognised

#13 Post by dasein »

samhain wrote:If nobody has any other ideas I will try reinstalling and not providing a root password at all, in the hope that this will set up the user account as a sudoer. Assuming that isn't an urban legend. I will report back.
There are still things you can try, if you can bring yourself to focus on finding a solution rather than admiring your oh-so-special problem.

But first, you need ask yourself which scenario is more likely:

1) There is a secret bug in Debian 8 that prevents you and only you from setting/resetting your root password; according to you, this bug has been around for a year now, so the thousands of people who successfully install Debian every day are just incredibly lucky.

2) You make the same mistake every time you install Debian 8, and the installer fails to properly handle whatever that mistake is.

3) If you're using the same medium (or the same .iso) to install now as you used a year ago, it's certainly possible that either your .iso or your medium is corrupt. Have you verified the checksum on both the downloaded .iso file and the medium you're using? (At the risk of belaboring a point, verifying one without verifying the other is a waste of effort.)

With that out of the way, you need to realize that when you are in "single user" mode or "recovery" mode, you are root and can do anything root might otherwise be able to do, including editing /etc/shadow. So boot into recovery/single user mode and:

Code: Select all

cd /etc
cp shadow shadow-bak
<your-favorite-text-editor here> shadow
then...

- find the line for the root account

- delete everything between the first pair of colons (but leave the colons themselves intact).

NOTE: If you FUBAR this step, exit the editor without saving (or restore the backup file (shadow-bak) and try again.

- save the file

- reboot

At this point, your root account will have no password whatsoever, so su will not require you to enter a password. (You should fix that at your very first opportunity.)

(Edited for clarity/emphasis)
Last edited by dasein on 2017-04-16 01:49, edited 2 times in total.

User avatar
dilberts_left_nut
Administrator
Administrator
Posts: 5346
Joined: 2009-10-05 07:54
Location: enzed
Has thanked: 12 times
Been thanked: 66 times

Re: root password is unrecognised

#14 Post by dilberts_left_nut »

What language / kb layout are you using?
AdrianTM wrote:There's no hacker in my grandma...

samhain
Posts: 9
Joined: 2017-04-15 17:09

Re: root password is unrecognised

#15 Post by samhain »

What language / kb layout are you using?
Good catch!

British English

When I thought about that I realised that the password had a character in it that is in a different position on British and US keyboards so I:
1. Set a new password that doesn't have that character in it (using sudo su - I had added my user to sudoers using a separate boot) and that worked.
2. Then again using a root terminal I changed it back again to the original one. And to my surprise that now works also.

So I think it is possible the installer in 8 may have some confusion about the keyboard layout. After all I have been through a number of installs of it that have had the same result with the same password. I do specify British English in the installer FWIW.
Maybe I am the only person who uses such a character in passwords && has British Keyboard && installs Debian 8 from the live DVD

For some reason, resetting the password via grub did not work.

But changing it in a root terminal eventually did.

Anyway it now works, and there is even an hypothesis to explain what happened.

So thank you :D

samhain
Posts: 9
Joined: 2017-04-15 17:09

Re: root password is unrecognised

#16 Post by samhain »

3) If you're using the same medium (or the same .iso) to install now as you used a year ago, it's certainly possible that either your .iso or your medium is corrupt. Have you verified the checksum on both the downloaded .iso file and the medium you're using? (At the risk of belaboring a point, verifying one without verifying the other is a waste of effort.)
For the record I verified the iso against the sha256 hash, and used cmp to compare the DVD and the iso (returned nothing)

The iso I used was: Debian Live 8.7.1 amd64 xfce, which I downloaded and burned to disk on Wednesday last week, so it was not the one I had used before.

Post Reply