LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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-28-2005, 09:31 AM   #1
lsj
LQ Newbie
 
Registered: Feb 2004
Posts: 28

Rep: Reputation: 15
admin can't log in..


after i checked my filesystem using fsck£¬when i log in as root,it replyed:login incorrect. i have no chance to input my passwd.
what is the matter?
 
Old 05-28-2005, 02:00 PM   #2
Dead Parrot
Senior Member
 
Registered: Mar 2004
Distribution: Debian GNU/kFreeBSD
Posts: 1,597

Rep: Reputation: 46
Maybe this will help?

http://linuxgazette.net/107/tomar.html
 
Old 05-28-2005, 11:58 PM   #3
lsj
LQ Newbie
 
Registered: Feb 2004
Posts: 28

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by Dead Parrot
Maybe this will help?

http://linuxgazette.net/107/tomar.html
it doesn't help.
the case is not that i forget my passwd for root , but i have no chance to input my passwd.when i have input username and kick RETURN,it display:Login incorrect..
and i can't use passwd to reset my passwd,after i booted into single user mode.
if i use apt-get to install new tools , some warning happen:
Code:
Gtk-WARNING**:cannot open display:at/usr/share/perl5/Debconf/FrontEnd/Gnome.pm line 47 
debconf:unable to initialize frontend:Gnome debconf:(DISPLAY:problem?) 
debconf:failing back to frontend:Dialog.
 
Old 05-29-2005, 12:18 AM   #4
Dead Parrot
Senior Member
 
Registered: Mar 2004
Distribution: Debian GNU/kFreeBSD
Posts: 1,597

Rep: Reputation: 46
I still have trouble understanding why the following advice (quoted from the link in my earlier post) wouldn't work in your case:
Quote:
Follow these steps to reset the password using Knoppix:

* Reboot the system and configure it to boot from the Knoppix CD (instructions available here)
* At the Knoppix Boot Prompt (See Fig. 3 below) enter: knoppix lang=us to start boot Knoppix using the english locale. If you understand German, feel free to just hit 'Enter' to boot into Knoppix.
* Once the system finishes booting, press <Ctrl> + <Alt> + <F1> (The Control, Alt and F1 key together) to switch to a virtual terminal.
* Type mkdir mountplace to create a directory called 'mountplace'. This is where we will mount the filesystem.
* Type mount /dev/hdaX mountplace, where /dev/hdaX is your root partition. More information on Linux partitions is available here.
* Change to the "/etc" directory on your root partition by typing cd mountplace/etc.
* Use your favorite text editor and open the 'shadow' file for editing. I use 'vi', so I type vi shadow (If you have a really old system, you won't have a shadow file, in which case you need to edit the 'passwd' file.)
* Scroll down to the line containing the root user's information, which looks something like:
root:dsfDSDF!s:12581:0:99999:7:::
* Delete everything between the first and second colons, so that the line looks like:
root::12581:0:99999:7:::
* Save the file and exit your editor.
* Type cd to return to your home directory.
* Type umount mountplace to unmount the partition.
* Type reboot to reboot your system, and remove the Knoppix CD from the drive.
* Now you can log into your system as root with no password. Make sure you change the password immediately.
The apt-get problem is easier to solve -- "su" to root, run "dpkg-reconfigure debconf", and choose "dialog" as the debconf frontend. This should end the warning messages.
 
Old 05-29-2005, 01:42 AM   #5
lsj
LQ Newbie
 
Registered: Feb 2004
Posts: 28

Original Poster
Rep: Reputation: 15
thanks for your help....
the apt-get problem has been resolved..
but i still can't log in...
i boot into single user mode and it doesn't need passwd for root .and i edited the /etc/passwd file..
i think there is nothing different with editing it using knoppix live CD..
it doesn't work...
when i init 3,
Code:
localhost login: root
Login incorrect.
localhost login:
and when i was in single user mode, i can't use "passwd" to reset my passwd..
it displayed:Mode is unknown..

 
Old 05-29-2005, 02:17 AM   #6
Dead Parrot
Senior Member
 
Registered: Mar 2004
Distribution: Debian GNU/kFreeBSD
Posts: 1,597

Rep: Reputation: 46
Quote:
i boot into single user mode and it doesn't need passwd for root .and i edited the /etc/passwd file..
You need to edit the /etc/shadow file, not /etc/passwd.
 
Old 05-29-2005, 03:27 AM   #7
lsj
LQ Newbie
 
Registered: Feb 2004
Posts: 28

Original Poster
Rep: Reputation: 15
thanks for your help...
my shadow likes this: root:$1$VSmtQ7QN$teCn6uRQdREVwXlkaPQfE0:12931:0:99999:7:::
i edit it as: root::12931:0:99999:7:::
and i reboot my box;
it doesn't help
and i boot into single user mode again(now it doesn't need any passwd in single user mode ,but in level 3, it doesn't work). i edit /etc/passwd as:
root::0:0:root:/root:/bin/bash (root:x:0:0:root:/root:/bin/bash)
it doesn't help too.
 
Old 05-29-2005, 04:13 AM   #8
Dead Parrot
Senior Member
 
Registered: Mar 2004
Distribution: Debian GNU/kFreeBSD
Posts: 1,597

Rep: Reputation: 46
Sorry, my knowledge ends here. I once lost my root password, booted Knoppix and accessed /etc/shadow, edited it just like you did, didn't touch /etc/passwd and it worked for me. I don't know why it doesn't work for you.

The top line in my /etc/passwd was then (and is still now):
root:x:0:0:root:/root:/bin/bash

There's definitely something very strange with your system if you can login as normal user and use apt-get without entering root password (or, apparently, any password). It isn't very healthy for your system that normal user has root privileges all the time. Maybe you could set the root password as normal user with the "passwd root" command. If that succeeds, you should probably back up your data, login as root, delete the user with abnormal rights with the "deluser" command and add a new user with the "adduser" command (and then possibly give the new user a password with "passwd" -- I don't remember if giving password is included with "adduser").

Last edited by Dead Parrot; 05-29-2005 at 04:17 AM.
 
Old 05-29-2005, 05:01 AM   #9
lsj
LQ Newbie
 
Registered: Feb 2004
Posts: 28

Original Poster
Rep: Reputation: 15
thanks very much...
i can't use apt-get when i log as normal user..
i use apt-get when i am root...
there is definitely somthing wrong with my system,but i don't know..
i tried "passwd root".it doesn't help...
thanks for all your help...
 
Old 05-29-2005, 06:42 AM   #10
Dead Parrot
Senior Member
 
Registered: Mar 2004
Distribution: Debian GNU/kFreeBSD
Posts: 1,597

Rep: Reputation: 46
Quote:
i can't use apt-get when i log as normal user..
i use apt-get when i am root...
OK, I guess you use apt-get in single user mode. (How else could you use apt-get as root when you cannot login as root?)

I got another idea. You could install sudo, add your user to sudoers and then do as normal user "sudo passwd root". I don't remember exactly how adding user to sudoers goes but it's something like this: boot into single user mode and edit /etc/sudoers . In /etc/sudoers there's a line for root, add a similar line for your normal user. Also do "adduser user_name sudo" (where "user_name" is your user name). After that you should be able to use sudo as normal user.

Last edited by Dead Parrot; 05-30-2005 at 12:50 AM.
 
Old 05-30-2005, 11:34 AM   #11
lsj
LQ Newbie
 
Registered: Feb 2004
Posts: 28

Original Poster
Rep: Reputation: 15
it has been resolved...
something is wrong with libpam-modules,i reinstalled it . And everything is OK now...
thanks for your help......
 
  


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
User admin and N/w admin on Gnome hangs ssrini *BSD 2 07-28-2005 07:55 AM
admin cannot log in trutnev Red Hat 2 05-25-2005 12:35 PM
cant log on as admin Mandrake92 Linux - Distributions 3 09-09-2004 08:46 PM
Log In as Admin (Mandrake 10) magikmaster Linux - Newbie 3 04-25-2004 04:12 AM
Unable to log into FTP: Using ProFTPd and MyWebFTP for Admin ShadowLeo Linux - Newbie 1 03-30-2004 10:39 AM

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

All times are GMT -5. The time now is 07:05 PM.

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