USA Linux Users Group Forum Index
Log in Register FAQ Memberlist Search USA Linux Users Group Forum Index Album

Recovering from a lost root password
Goto page Previous  1, 2, 3, 4  Next
 
Post new topic   Reply to topic   printer-friendly view    USA Linux Users Group Forum Index » System Administration and Security
View previous topic :: View next topic  
Author Message
JP
Linux Guru


Joined: 07 Jul 2024
Posts: 6670
Location: Central Montana

PostPosted: Wed Jun 11, 2024 6:14 am    Post subject: Re: Recovering from a lost root password Reply with quote

crouse wrote:

Open a terminal window.
Code:
/mnt/hda1

then do
Code:
chroot /mnt/hda1



This won't work for me in Knoppix 5.3.1 Confused

Code:
root@Knoppix:/# /mnt/hda1
bash: /mnt/hda1: is a directory
root@Knoppix:/# chroot /mnt/hda1
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
                                         

And the prompt doesn't come back so I can do anything. So Dave, what am I doing wrong? Is it becuz I'm already root? Confused



_________________
Dell Box - Arch Linux
Dell Lappy - DreamLinux 3.5 - Default OS
Mepis 8.0 - Backup
Back to top
View user's profile Send private message Visit poster's website
inactive
Sr. Member


Joined: 29 Aug 2024
Posts: 1207

PostPosted: Sun Jun 15, 2024 7:25 am    Post subject: Reply with quote

it's
Code:
mount hda1


then the chroot



_________________
Mandriva 2024.1 PWP
Mandriva Cooker
ArtistX live
Back to top
View user's profile Send private message
JP
Linux Guru


Joined: 07 Jul 2024
Posts: 6670
Location: Central Montana

PostPosted: Sun Jun 15, 2024 7:39 am    Post subject: Reply with quote

Thanks, but that doesn't work either, when I do
Code:
root@Knoppix:ranmdisk/home/knoppix# mount hda1
mount: can't find hda1 in /etc/fstab or /etc/mtab
root@Knoppix:ranmdisk/home/knoppix#


Maybe it's the Knoppix Confused



_________________
Dell Box - Arch Linux
Dell Lappy - DreamLinux 3.5 - Default OS
Mepis 8.0 - Backup


Last edited by JP on Sun Jun 15, 2024 7:46 am; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
inactive
Sr. Member


Joined: 29 Aug 2024
Posts: 1207

PostPosted: Sun Jun 15, 2024 7:41 am    Post subject: Reply with quote

Welcome. Smile



_________________
Mandriva 2024.1 PWP
Mandriva Cooker
ArtistX live
Back to top
View user's profile Send private message
JP
Linux Guru


Joined: 07 Jul 2024
Posts: 6670
Location: Central Montana

PostPosted: Sun Jun 15, 2024 7:47 am    Post subject: Reply with quote

DedannaRocks! wrote:
Welcome. Smile
HUH??



_________________
Dell Box - Arch Linux
Dell Lappy - DreamLinux 3.5 - Default OS
Mepis 8.0 - Backup
Back to top
View user's profile Send private message Visit poster's website
jester
Sr. Member


Joined: 19 Apr 2024
Posts: 1166

PostPosted: Sun Jun 15, 2024 8:52 am    Post subject: Reply with quote

JP to chroot from knoppix, please see the instructions in your sidux thread



_________________
Arch64 :: Funtoo64 :: FreeBSD-8.0 :: OSX-10.4.11 (PPC)
Testing: Fedora12_x86-64 :: Ubuntu-10.04-LTS_x86-64
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
inactive
Sr. Member


Joined: 29 Aug 2024
Posts: 1207

PostPosted: Mon Jun 16, 2024 5:03 am    Post subject: Reply with quote

JP wrote:
DedannaRocks! wrote:
Welcome. Smile
HUH??

Sorry, cross-post to your next post. I hadn't seen it yet.



_________________
Mandriva 2024.1 PWP
Mandriva Cooker
ArtistX live
Back to top
View user's profile Send private message
JP
Linux Guru


Joined: 07 Jul 2024
Posts: 6670
Location: Central Montana

PostPosted: Tue Jun 17, 2024 4:32 am    Post subject: Reply with quote

DedannaRocks! wrote:
JP wrote:
DedannaRocks! wrote:
Welcome. Smile
HUH??

Sorry, cross-post to your next post. I hadn't seen it yet.


This wasn't a cross-post to my sidux thread, I was doing some CLI practice and found that this formula didn't work for me .... I guess I should have made that clear up front. Sorry!!



_________________
Dell Box - Arch Linux
Dell Lappy - DreamLinux 3.5 - Default OS
Mepis 8.0 - Backup
Back to top
View user's profile Send private message Visit poster's website
masinick
Linux Guru


Joined: 03 Apr 2024
Posts: 8615
Location: Concord, NH

PostPosted: Tue Jun 17, 2024 10:59 pm    Post subject: Reply with quote

DedannaRocks! wrote:
it's
Code:
mount hda1


then the chroot


I would explicitly add the complete path, that is,
Code:
mount /hda1
, replacing hda1 with whatever the actual partition name happens to be. I think it would be sda1 if that is a sidux system, but KNOPPIX may still recognize it as hda1 - I know PCLinuxOS still uses hd naming conventions in PCLinuxOS 2024, even with packaging updates.



_________________
Brian Masinick
Distros: SimplyMEPIS
sidux - no CAPS!, antiX, Debian
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
inactive
Sr. Member


Joined: 29 Aug 2024
Posts: 1207

PostPosted: Wed Jun 18, 2024 8:50 am    Post subject: Reply with quote

Sorry, forgot the / .

Try /dev/hda1



_________________
Mandriva 2024.1 PWP
Mandriva Cooker
ArtistX live
Back to top
View user's profile Send private message
JP
Linux Guru


Joined: 07 Jul 2024
Posts: 6670
Location: Central Montana

PostPosted: Wed Jun 18, 2024 3:07 pm    Post subject: Reply with quote

I still get the same thing ....
Code:
root@Knoppix:/ramdisk/home/knoppix# mount /dev/hda1
root@Knoppix:/ramdisk/home/knoppix# /mnt/hda1
bash: /mnt/hda1: is a directory
root@Knoppix:/ramdisk/home/knoppix# chroot /mnt/hda1
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied


Code:
root@Knoppix:/ramdisk/home/knoppix# mount /dev/sda1
mount: can't find /dev/sda1 in /etc/fstab or /etc/mtab
root@Knoppix:/ramdisk/home/knoppix# /mnt/sda1
bash: /mnt/sda1: No such file or directory
root@Knoppix:/ramdisk/home/knoppix#


So my question still stands, is it possible it's the Knoppix /or the way I'm using Knoppix? I think Knoppix is already in root, but I "su" to make sure and then change the password (Thanks to Masinick for that tip), before I do all of this other stuff Wink
NOTE: this is the Knoppix 5.3.1 DVD that came with Linux Pro Magazine, and it has been working great, so I'm not trying to complain about the DVD, I'm wondering if there is a different sequence of commands that are used in a Knoppix mount than in a slax mount. In other words,

Code:
knoppix@Knoppix:~$ su
root@Knoppix:/ramdisk/home/knoppix# passwd
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully


I think Knoppix is already in the root account.

Code:
knoppix@Knoppix:~$ pwd
/ramdisk/home/knoppix
knoppix@Knoppix:~$ whoami
knoppix
knoppix@Knoppix:~$ su
root@Knoppix:/ramdisk/home/knoppix# pwd
/ramdisk/home/knoppix
root@Knoppix:/ramdisk/home/knoppix# whoami
root
root@Knoppix:/ramdisk/home/knoppix#


You see, it doesn't ask for a password to change from "knoppix" to "root."



_________________
Dell Box - Arch Linux
Dell Lappy - DreamLinux 3.5 - Default OS
Mepis 8.0 - Backup
Back to top
View user's profile Send private message Visit poster's website
jester
Sr. Member


Joined: 19 Apr 2024
Posts: 1166

PostPosted: Wed Jun 18, 2024 3:29 pm    Post subject: Reply with quote

did you try su - ?



_________________
Arch64 :: Funtoo64 :: FreeBSD-8.0 :: OSX-10.4.11 (PPC)
Testing: Fedora12_x86-64 :: Ubuntu-10.04-LTS_x86-64
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
masinick
Linux Guru


Joined: 03 Apr 2024
Posts: 8615
Location: Concord, NH

PostPosted: Thu Jun 19, 2024 1:43 am    Post subject: Reply with quote

su is used to become another user during a login session. Invoked
without a username, su defaults to becoming the super user. The
optional argument - may be used to provide an environment similar to
what the user would expect had the user logged in directly.

As Jester suggests, using the - argument may prove useful in order to get the correct environment prior to using the chroot command. Give that a try and let us know what you get. Sure looks like your version of KNOPPIX still adheres to the hd rather than sd device naming convention. I am a bit rusty on the particulars, but I *think* it is udev that provides the new and different device naming convention.



_________________
Brian Masinick
Distros: SimplyMEPIS
sidux - no CAPS!, antiX, Debian
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
JP
Linux Guru


Joined: 07 Jul 2024
Posts: 6670
Location: Central Montana

PostPosted: Thu Jun 19, 2024 4:46 am    Post subject: Reply with quote

Code:
knoppix@Knoppix:~$ su -
root@Knoppix:~# passwd
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
root@Knoppix:~# pwd
/root
root@Knoppix:~# whoami
root
root@Knoppix:~# mount /dev/hda1
root@Knoppix:~# /mnt/hda1
-su: /mnt/hda1: is a directory
root@Knoppix:~# chroot /mnt/hda1
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied



_________________
Dell Box - Arch Linux
Dell Lappy - DreamLinux 3.5 - Default OS
Mepis 8.0 - Backup
Back to top
View user's profile Send private message Visit poster's website
jester
Sr. Member


Joined: 19 Apr 2024
Posts: 1166

PostPosted: Thu Jun 19, 2024 11:34 am    Post subject: Reply with quote

JP wrote:
Code:
knoppix@Knoppix:~$ su -
root@Knoppix:~# passwd
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
root@Knoppix:~# pwd
/root
root@Knoppix:~# whoami
root
root@Knoppix:~# mount /dev/hda1
root@Knoppix:~# /mnt/hda1
-su: /mnt/hda1: is a directory
root@Knoppix:~# chroot /mnt/hda1
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied
bash: /dev/null: Permission denied

JP - that looks like progress up until the mount /dev/hda1; I strongly suggest that you review the chroot steps I posted in your sidux thread i.e. make a new mount point, mount that on /dev/hda1, make sure you also mount /mount/point/proc with the correct arguments all before you chroot /mount/point /bin/bash

why follow those steps? because they are part of the 'genuine' gentoo install and I know they work for recovery too

you are incredibly close


Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    USA Linux Users Group Forum Index » System Administration and Security All times are GMT
Goto page Previous  1, 2, 3, 4  Next
Page 3 of 4

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All content © 2024-2009 - Usa Linux Users Group
This forum is powered by phpBB. © 2024-2009 phpBB Group
Theme created by phpBBStyles.com and modified by Crouse