LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Using Linux for widows (https://www.linuxquestions.org/questions/linux-newbie-8/using-linux-for-widows-4175639225/)

NEWBIE#101 09-26-2018 02:28 PM

Using Linux for widows
 
I'm sure you will tell me this is a windows problem.(I have contacted microsoft) but I am using a friends Linux Mint usb to help me with this situation. The problem is the password. The password was changed and now I cannot log on no matter what I do. He gave some info on what to do but I'm at a stand still. I'm not sure what to do or how to do it. This is what I have done so far but there are issues. If you could advise I'd be grateful if not np.

peppermint@peppermint ~ $ sudo apt-get install chntpw
Reading package lists... Done
Building dependency tree
Reading state information... Done
chntpw is already the newest version (1.0-1build1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
peppermint@peppermint ~ $ $ sudo fdisk -l
$: command not found
peppermint@peppermint ~ $ sudo lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
loop0 7:0 0 1.3G 0 loop /cdrom
loop1 7:1 0 1.2G 1 loop /rofs
sda 8:0 0 465.8G 0 disk
├─sda1 8:1 0 39.2M 0 part
├─sda2 8:2 0 7.9G 0 part
└─sda3 8:3 0 457.9G 0 part /media/peppermint/OS
sdb 8:16 1 3.8G 0 disk
└─sdb1 8:17 1 3.8G 0 part /isodevice
zram0 252:0 0 747.8M 0 disk [SWAP]
zram1 252:1 0 747.8M 0 disk [SWAP]
peppermint@peppermint ~ $ $ sudo mkdir /media/windows
$: command not found
peppermint@peppermint ~ $ sudo mkdir /media/windows
peppermint@peppermint ~ $ sudo mount /dev/sda2 /media/windows
peppermint@peppermint ~ $ sudo fdisk -l
Disk /dev/loop0: 1.3 GiB, 1366294528 bytes, 2668544 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x46be5c62

Device Boot Start End Sectors Size Id Type
/dev/loop0p1 * 0 2668543 2668544 1.3G 17 Hidden HPFS/NTFS


Disk /dev/loop1: 1.2 GiB, 1291608064 bytes, 2522672 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xec0328c2

Device Boot Start End Sectors Size Id Type
/dev/sda1 63 80324 80262 39.2M de Dell Utility
/dev/sda2 * 81920 16607231 16525312 7.9G 7 HPFS/NTFS/exFAT
/dev/sda3 16607232 976771071 960163840 457.9G 7 HPFS/NTFS/exFAT


Disk /dev/sdb: 3.8 GiB, 4026531840 bytes, 7864320 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x59bc0f06

Device Boot Start End Sectors Size Id Type
/dev/sdb1 * 128 7864319 7864192 3.8G 7 HPFS/NTFS/exFAT


Disk /dev/zram0: 747.8 MiB, 784125952 bytes, 191437 sectors
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/zram1: 747.8 MiB, 784125952 bytes, 191437 sectors
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
peppermint@peppermint ~ $ sudo mkdir /media/windows
mkdir: cannot create directory ‘/media/windows’: File exists
peppermint@peppermint ~ $ sudo mount /dev/sda2 /media/windows
Mount is denied because the NTFS volume is already exclusively opened.
The volume may be already mounted, or another software may use it which
could be identified for example by the help of the 'fuser' command.
peppermint@peppermint ~ $ chntpw -l /media/windows/Windows/system32/config/software
chntpw version 1.00 140201, (c) Petter N Hagen
openHive(/media/windows/Windows/system32/config/software) failed: No such file or directory, trying read-only
openHive(/media/windows/Windows/system32/config/software) in fallback RO-mode failed: No such file or directory
chntpw: Unable to open/read a hive, exiting..
peppermint@peppermint ~ $ cd Microsoft\Windows NT\CurrentVersion\Winlogon
bash: cd: too many arguments.

It has been mounted and there is a file.

Thank you for your time.

Keruskerfuerst 09-26-2018 02:40 PM

What do you want to do exactly ?

When you want to access the data on the windows machine, then use another windows computer with a working installation and mount the disc into this computer.
Then you read the hole data on this computer (with some exceptions).

TB0ne 09-26-2018 03:06 PM

Quote:

Originally Posted by NEWBIE#101 (Post 5908086)
I'm sure you will tell me this is a windows problem.(I have contacted microsoft) but I am using a friends Linux Mint usb to help me with this situation. The problem is the password. The password was changed and now I cannot log on no matter what I do. He gave some info on what to do but I'm at a stand still. I'm not sure what to do or how to do it. This is what I have done so far but there are issues. If you could advise I'd be grateful if not np.

First, you're right: this IS a Windows problem. And I find it very hard to believe that Microsoft can't help you with this, seeing as there are many, MANY articles in their own knowlegebase dealing specifically with this.

There are also lots of articles Google returns, to tell you how to reset your password:
https://www.windowspasswordsreset.co...hout-disk.html

ondoho 09-29-2018 02:15 AM

i am also a little unclear about what you are trying ot achieve.
are you saying you are trying to recover a lost windows password?
that i wouldn't know how to do.
or are you trying to recover data from a windows partition?
that should be near trivial. unless encryption is involved?

oh and please use code tags for code.

NEWBIE#101 09-29-2018 07:18 AM

Quote:

Originally Posted by ondoho (Post 5909086)
i am also a little unclear about what you are trying ot achieve.
are you saying you are trying to recover a lost windows password?
that i wouldn't know how to do.
or are you trying to recover data from a windows partition?
that should be near trivial. unless encryption is involved?

oh and please use code tags for code.

Yes we are trying to recover a password(microsoft had my friend change his password 3x's and he still can't logon) I was told that a bootable linux usb would be of use but as you can see I'm unaware of how tp do this. What's a code tag? Thanks for at least responding.

yancek 09-29-2018 08:51 AM

Quote:

chntpw -l /media/windows/Windows/system32/config/software
You are using a Linux OS to access this directory from a terminal which means case sensitivity applies. You get the "no such file or directory" error message because it is System32 not system32.

You might post more detail on what your friend was told to do by microsoft and the results of the attempts.

Quote:

peppermint@peppermint ~ $ cd Microsoft\Windows NT\CurrentVersion\Winlogon
The above command would probably 'work' if you were in the directory immediately above 'Microsoft' and you used forward slashes ( / ) rather than backward ( \ ).

This method apparently works, the link below explains using it in Fedora. The only difference I would expect is how to install on Fedora as opposed to Ubuntu/Mint which is irrelevant since you already have it.

NEWBIE#101 09-29-2018 10:28 AM

Quote:

Originally Posted by yancek (Post 5909183)
You are using a Linux OS to access this directory from a terminal which means case sensitivity applies. You get the "no such file or directory" error message because it is System32 not system32.

You might post more detail on what your friend was told to do by microsoft and the results of the attempts.



The above command would probably 'work' if you were in the directory immediately above 'Microsoft' and you used forward slashes ( / ) rather than backward ( \ ).

This method apparently works, the link below explains using it in Fedora. The only difference I would expect is how to install on Fedora as opposed to Ubuntu/Mint which is irrelevant since you already have it.

Thank you for a much better explanation, anyway, he was told to make a bootable usb of any Linux distro, he had one of Peppermint ,then to "mount windows" than to get a pkg named "chntpw" but as far as what comes next is unclear as you can see by the first post. Moving on , he tried to follow the suggestions you gave (I do not know squat about Linux and it's obvious the little he knows isn't enough) this is what came up:

peppermint@peppermint ~ $ chntpw -l\media\Windows\Windows\System32\config\software
chntpw: invalid option -- 'm'
chntpw: change password of a user in a Windows SAM file,
or invoke registry editor. Should handle both 32 and 64 bit windows and
all version from NT3.x to Win8.1
chntpw [OPTIONS] <samfile> [systemfile] [securityfile] [otherreghive] [...]
-h This message
-u <user> Username or RID (0x3e9 for example) to interactively edit
-l list all users in SAM file and exit
-i Interactive Menu system
-e Registry editor. Now with full write support!
-d Enter buffer debugger instead (hex editor),
-v Be a little more verbose (for debuging)
-L For scripts, write names of changed files to /tmp/changed
-N No allocation mode. Only same length overwrites possible (very safe mode)
-E No expand mode, do not expand hive file (safe mode)

Usernames can be given as name or RID (in hex with 0x first)

See readme file on how to get to the registry files, and what they are.
Source/binary freely distributable under GPL v2 license. See README for details.
NOTE: This program is somewhat hackish! You are on your own!
peppermint@peppermint ~ $

Thanks again for your help.

TB0ne 09-29-2018 11:50 AM

Quote:

Originally Posted by NEWBIE#101 (Post 5909198)
Thank you for a much better explanation, anyway, he was told to make a bootable usb of any Linux distro, he had one of Peppermint ,then to "mount windows" than to get a pkg named "chntpw" but as far as what comes next is unclear as you can see by the first post. Moving on , he tried to follow the suggestions you gave (I do not know squat about Linux and it's obvious the little he knows isn't enough) this is what came up:

peppermint@peppermint ~ $ chntpw -l\media\Windows\Windows\System32\config\software
chntpw: invalid option -- 'm'
chntpw: change password of a user in a Windows SAM file,
or invoke registry editor. Should handle both 32 and 64 bit windows and
all version from NT3.x to Win8.1
chntpw [OPTIONS] <samfile> [systemfile] [securityfile] [otherreghive] [...]
-h This message
-u <user> Username or RID (0x3e9 for example) to interactively edit
-l list all users in SAM file and exit
-i Interactive Menu system
-e Registry editor. Now with full write support!
-d Enter buffer debugger instead (hex editor),
-v Be a little more verbose (for debuging)
-L For scripts, write names of changed files to /tmp/changed
-N No allocation mode. Only same length overwrites possible (very safe mode)
-E No expand mode, do not expand hive file (safe mode)

Usernames can be given as name or RID (in hex with 0x first)

See readme file on how to get to the registry files, and what they are.
Source/binary freely distributable under GPL v2 license. See README for details.
NOTE: This program is somewhat hackish! You are on your own!
peppermint@peppermint ~ $

Thanks again for your help.

Sorry, but again, why are you doing this with Linux?? I gave you a link that tells you explicitly how to do this without a Windows password recovery disk, just by booting from the Windows installation media. And you say you contacted Microsoft; they have at least a dozen articles on their knowledgebase about how to do this. Still not seeing why you're involving Linux of any sort into this, as all it does it make things more complicated.

Boot to the Windows recovery partition, or download a Windows 10 ISO image (free) from their website, and boot from it. Use the built-in Windows utilities to reset the password.

hydrurga 09-29-2018 01:25 PM

Another option:

http://pogostick.net/~pnh/ntpasswd/

yancek 09-29-2018 02:14 PM

Quote:

peppermint@peppermint ~ $ chntpw -l\media\Windows\Windows\System32\config\software
I've never used this software but I would expect doing something like this would require root privileges so you should at least preface the command with sudo. You are alos using windows backward slash instead of the Linux forward slash in the path and that won't work. I would also expect that you would need a space after the command/parameter. The message you are getting is just telling you that the command is incorrect. I would expect you would get better results with a correct command path as below:

Quote:

sudo chntpw -l /media/Windows/Windows/System32/config/software
On my system from Linux, the software file is all uppercase (SOFTWARE) so you might try changing that.

Even better, use windows software as suggested above. Should be a lot easier.

ondoho 09-30-2018 04:24 AM

NEWBIE#101, on Linux you need to use forward slashes for paths, even if they are on a windows partition:
Code:

/path/to/windows
it is also case sensitive as already mentioned.

you also need to put straight double quotes around paths containing spaces:
Code:

cd "/path/to/Windows NT/bla"

NEWBIE#101 10-01-2018 05:08 AM

Thanks for the help but, I just don't get this system at all. Anyway, in answer to several questions why am I doing this? trying to help out a friend who was told he could be helped by Linux. As far as Microsoft true they have a lot of articles on the subject but, they also have a lot of people who still can't logon to their systems. Thanks for your help.

yancek 10-01-2018 08:05 AM

Are you getting the same errors when you run the command below? Or have you now resolved this problem?

Code:

sudo chntpw -l /media/windows/Windows/System32/config/SOFTWARE
In the command above, the first 'windows' needs to be 'windows' beginning with a Lower Case Letter 'w' which you do correctly in some commands and not others.
System32 needs to begin with an upper case letter 'S' and the file name software needs to be all uppercase: SOFTWARE. That's just the way it works with Linux.

Code:

peppermint@peppermint ~ $ cd Microsoft\Windows NT\CurrentVersion\Winlogon
The command above has 2 errors in it. First you are using backward slashes ( \ ) rather than forward slashes ( / ) and you have a space between Windows and NT so you would need the command in quotes. You would also need to be in the directory immediately above wherever the Microsoft directory exists. So if the Microsoft directory was in the root of the filesystem, you would need the command below.

Code:

cd "/media/windows/Microsoft/Windows NT/CurrentVersion/Winlogon/"
I don't know which release of windows you are using, I only have windows 10 and there is no Microsoft directory in the root of the filesystem.

TB0ne 10-01-2018 08:14 AM

Quote:

Originally Posted by NEWBIE#101 (Post 5909662)
Thanks for the help but, I just don't get this system at all. Anyway, in answer to several questions why am I doing this? trying to help out a friend who was told he could be helped by Linux.

Who told your friend that, and why aren't they helping him, then?
Quote:

As far as Microsoft true they have a lot of articles on the subject but, they also have a lot of people who still can't logon to their systems. Thanks for your help.
Sorry, but the link I gave you explicitly tells you *EXACTLY* how to use a bootable Microsoft Windows 10 install media to recover your password...step by step, and I've used those instructions MANY times. And rather than saying that yes, you know there are articles about Microsoft's tools...you don't actually tell us what Microsoft TOLD YOU (when you contacted them), what you did/tried from them, or what articles from MS you followed, that you're not having luck with.

The link I provided has exact steps (with pictures). You can even boot from a recovery partition on your system if you have one, and this whole procedure should take you less than five minutes.

NEWBIE#101 10-01-2018 09:23 AM

Quote:

Originally Posted by TB0ne (Post 5909720)
Who told your friend that, and why aren't they helping him, then?

Sorry, but the link I gave you explicitly tells you *EXACTLY* how to use a bootable Microsoft Windows 10 install media to recover your password...step by step, and I've used those instructions MANY times. And rather than saying that yes, you know there are articles about Microsoft's tools...you don't actually tell us what Microsoft TOLD YOU (when you contacted them), what you did/tried from them, or what articles from MS you followed, that you're not having luck with.

The link I provided has exact steps (with pictures). You can even boot from a recovery partition on your system if you have one, and this whole procedure should take you less than five minutes.

What you say is all true but, the only pc he has is the one he can't log onto so he can't download anything to use, that is why the linux usb was suggedted and as far as I know you need to install before you can download so I'm guessing he wouldn't be able to do that when he has the linux usb connected. Correct me if I'm wrong. Thanks for the help.


All times are GMT -5. The time now is 06:45 AM.