LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 05-02-2011, 09:55 AM   #1
Landshark
LQ Newbie
 
Registered: Apr 2007
Posts: 10

Rep: Reputation: 0
Debian 6 new install: Can't log in as user or root


This is embarrassing to ask:

I installed Debian 6 yesterday. I always use the same user and root passwords when setting up a machine and then change them once I'm done, but neither work. Today I can't log in.

User error? Possibly, but I still don't get it.

Any way around this other than reinstalling? My hope was that I could force Debian to allow me to set up the user and root credentials again from the set up process, but I haven't been able to figure it out. I think I'm stuck but wanted to ask in case there were any suggestions.

Thanks for any insight.

<landshark scratches head>

Last edited by Landshark; 05-02-2011 at 09:59 AM.
 
Old 05-02-2011, 10:13 AM   #2
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
@ Reply

Hi there,

I dont think so debian allow to set a root user password during installation. That does not mean that the root user does not exist. Root user is there but the password is set to some hash value.

What you have to do is you can login with the account that you have created during installation and then from that account do sudo passwd root.

If that does not work refer to the link below:

http://www.debuntu.org/recover-root-...-mode-and-grub
 
Old 05-02-2011, 10:23 AM   #3
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
Quote:
Originally Posted by T3RM1NVT0R View Post
Hi there,

I dont think so debian allow to set a root user password during installation. That does not mean that the root user does not exist. Root user is there but the password is set to some hash value.

What you have to do is you can login with the account that you have created during installation and then from that account do sudo passwd root.

If that does not work refer to the link below:

http://www.debuntu.org/recover-root-...-mode-and-grub
Wrong. Unlike Ubuntu and its derivatives Debian uses a root account in a standard install, if you do not explicitly disable it at installation time.

@Landshark: When in Grub edit your kernel line so that it contains init=/bin/bash and then boot. You will get a commandline where you can change the password with the passwd-command.

Last edited by TobiSGD; 05-02-2011 at 10:24 AM.
 
1 members found this post helpful.
Old 05-02-2011, 10:36 AM   #4
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
@ Reply

Quote:
Wrong. Unlike Ubuntu and its derivatives Debian uses a root account in a standard install, if you do not explicitly disable it at installation time.
I have performed the installation of Ubuntu 10.04 without disabling/changing any parameter but it didnt ask me the root password during the installation. Later when I tried to login using root it wasn't accepting the password (obviously because no root password was set). What I am trying to say here is that it uses the root account but the root password setting option you do not get during installation (This I have checked in Debian, Ubuntu, Linux Mint) it is set to some default hash value as no root password is a security breach.

Any of the flavours derived from Debian does not prompt use of root for regular daily task and that is the reason they give sudo access to the user account created during install. Once the installation is done and if you would like you can reset the root password.
 
Old 05-02-2011, 11:02 AM   #5
Arcane
Member
 
Registered: May 2006
Location: Latvia, Europe
Distribution: random
Posts: 310

Rep: Reputation: 312Reputation: 312Reputation: 312Reputation: 312
Quote:
Originally Posted by T3RM1NVT0R View Post
{...}What I am trying to say here is that it uses the root account but the root password setting option you do not get during installation{...}
You're clueless. Debian DOES ask for root password in installation. Also Ubuntu but difference is - ubuntu uses same user password for root privileges(result is merged password and you won't see message "enter root password" during install) so it creates confusion.
 
1 members found this post helpful.
Old 05-02-2011, 11:22 AM   #6
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
Quote:
Originally Posted by T3RM1NVT0R View Post
What I am trying to say here is that it uses the root account but the root password setting option you do not get during installation (This I have checked in Debian, Ubuntu, Linux Mint) it is set to some default hash value as no root password is a security breach.
Wrong at least for Debian. Have a look at this installation tutorial with screenshots, the step where you have to input the root-password is the 11th picture from top.
 
1 members found this post helpful.
Old 05-02-2011, 11:22 AM   #7
Landshark
LQ Newbie
 
Registered: Apr 2007
Posts: 10

Original Poster
Rep: Reputation: 0
Here's what I ran into:

Appending init=/bin/bash to the kernel line worked great and allowed me to access a shell as root.

But using passwd repeatedly resulted in the same error message no matter what I used for a password. After entering the verification, I got:

"Authentication token manipulation error." The password was therefore unchanged / I couldn't create the new one. (I even tried 1234 to make it as simple as possible.)

So then I attempted to use vi to edit /etc/shadow, hoping to delete the current root password and leave it blank. But the permissions for this file would not let me do this either. (Come to think of it, I should have tried to change the permissions, eh?)

Thoughts?

landshark
 
Old 05-02-2011, 11:58 AM   #8
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
@ Reply

Thank you guys for pointing that to me. I was in a impression unlike Linux Mint, Ubuntu, Debian does not prompt for the root password and I have heard this in some forum or on the internet.

Special thanks to TobiSGD for pointing out those screenshots.

Thanks again. :-)
 
Old 05-02-2011, 12:11 PM   #9
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
@ Reply

@Landshark

Did you try the steps mentioned in the link I posted before in this thread.

The reason you are not able to make changes to /etc/shadow as the filesystem mounted as read only.

Do mount -o remount,rw / and then try to do passwd.
 
1 members found this post helpful.
Old 05-02-2011, 12:15 PM   #10
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
Quote:
Originally Posted by T3RM1NVT0R View Post
The reason you are not able to make changes to /etc/shadow as the filesystem mounted as read only.

Do mount -o remount,rw / and then try to do passwd.
Sorry, I forgot about that.
 
Old 05-02-2011, 02:02 PM   #11
Landshark
LQ Newbie
 
Registered: Apr 2007
Posts: 10

Original Poster
Rep: Reputation: 0
Thanks for all your help. I was able to cobble together a workable solution and now have accessible root and user accounts. Much appreciated.
 
Old 07-23-2011, 04:11 AM   #12
leo27
LQ Newbie
 
Registered: Apr 2011
Posts: 7

Rep: Reputation: 0
hello,

newbie here. just installed debian 6.0.2 and i encountered exactly the same problem. just would like to ask a step by step procedure on how to do this one:
Quote:
Originally Posted by Landshark View Post
Here's what I ran into:

Appending init=/bin/bash to the kernel line worked great and allowed me to access a shell as root.

landshark
and also, other procedures found on this thread that seem to have helped solve this problem.
thanks a lot
 
Old 07-25-2011, 05:18 AM   #13
leo27
LQ Newbie
 
Registered: Apr 2011
Posts: 7

Rep: Reputation: 0
hi!
i was able to figure out how to edit grub parameters and append init=/bin/bash on the "linux..." line (i cannot seem to find the "kernel..." line as mentioned above) and i am prompted by a commandline but typing 'passwd' command would give me a COMMAND NOT FOUND error. should i type the full path of the command? i'm not sure where the command is located. by the way, i installed debian 6.0.2 and GNU Grub is version 1.98.

thanks for sharing your thoughts...
 
Old 07-25-2011, 09:27 PM   #14
leo27
LQ Newbie
 
Registered: Apr 2011
Posts: 7

Rep: Reputation: 0
i tried /etc/passwd but it says permisssion denied.... :-( help...
 
Old 07-26-2011, 04:26 AM   #15
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
Try it with /usr/bin/passwd
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Some application installation questions: log in as root or log in as 'user' & do 'su' Robert.Thompson Slackware 9 02-25-2011 08:19 AM
Log off/log on as different user breaks X apps under Debian 5.0.1 lbdu Debian 1 06-26-2009 05:54 AM
Cant only log in as root after user log-in. ADJenkins Linux - General 2 11-17-2004 04:18 PM
Log Out root Then Log In As Other User xtremcoder Linux - General 4 10-04-2004 11:01 PM
How to log in as root user Ree Linux - Newbie 4 09-30-2004 04:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 12:27 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration