- Linux find Windows 10 OEM product key command
- How To – Linux find Windows 10 OEM product key
- Say hello to /sys/firmware/acpi/tables
- How to retrieve Windows 8 and Windows 10 OEM product key from BIOS when using Linux
- A note about retrieving the product key in Windows 10 or Windows 8 itself
- Conclusion
- SSH on Windows Subsystem for Linux (WSL)
- Prerequisite:
- Install SSH
- Edit the sshd_config
- Start or restart the SSH service
- Allow SSH service to start without password
- Add a Windows Task Scheduler to automatically start ssh server
- Enable Port 22 in Windows Firewall
- Test SSH Remote Connection
- Conclusion
- Can I recover my Windows product key from Ubuntu? [duplicate]
- 2 Answers 2
Linux find Windows 10 OEM product key command
I removed and installed Ubuntu Linux 16.04 LTS on my development Lenovo laptop. However, I need to use my Windows 10 pro in KVM VM for running the accounting app. How do I find and print my embedded Windows 10 pro key from a Linux command line option? How can I retrieve Microsoft Windows 8 and 10 OEM product key from BIOS?
Most modern desktop and laptop comes with Windows 8 or 10 keys embedded in BIOS. Thinkpad, Dell, and many other BIOS vendors expose these keys to Linux, too, along with tons of data. So one can find and retrieve Windows 10 or Windows 8 key using Linux. The key helps to activate the Windows version without any input from users.
Tutorial details | |
---|---|
Difficulty level | Easy |
Root privileges | Yes |
Requirements | Linux |
Est. reading time | 3 minutes |
How To – Linux find Windows 10 OEM product key
To find your original Windows 10 product key from Linux:
- Open the terminal application.
- You must run the Linux command as the root user.
- Type ‘ sudo strings /sys/firmware/acpi/tables/MSDM ‘ to print Windows 10 or Windows 8 OEM product key
- You can also use the acpidump command to get the same information under Linux.
Let us see all the commands and examples in detail to located Windows 10 OEM serial number or key.
Say hello to /sys/firmware/acpi/tables
ACPI tables can be retrieved via sysfs in latest Linux kernels. For example, type the following ls command:
ls -l /sys/firmware/acpi/tables/
Sample outputs:
The /sys/firmware/acpi/tables facility can be used by platform/BIOS vendors to provide a Linux compatible environment without modifying the underlying platform firmware. This facility also provides a powerful feature to debug and test ACPI BIOS table compatibility quickly with the Linux kernel by changing the old platform provided ACPI tables or inserting new ACPI tables.
How to retrieve Windows 8 and Windows 10 OEM product key from BIOS when using Linux
First, open the terminal application by pressing Ctrl – Alt + T keyboard shortcut. Then type the following cat command:
sudo cat /sys/firmware/acpi/tables/MSDM
Feel free to use the tail command as shell pipe:
sudo cat /sys/firmware/acpi/tables/MSDM | tail -1
Retrieve an embedded Windows OEM key using Linux operating system
- No ads and tracking
- In-depth guides for developers and sysadmins at Opensourceflare✨
- Join my Patreon to support independent content creators and start reading latest guides:
- How to set up Redis sentinel cluster on Ubuntu or Debian Linux
- How To Set Up SSH Keys With YubiKey as two-factor authentication (U2F/FIDO2)
- How to set up Mariadb Galera cluster on Ubuntu or Debian Linux
- A podman tutorial for beginners – part I (run Linux containers without Docker and in daemonless mode)
- How to protect Linux against rogue USB devices using USBGuard
Join Patreon ➔
A note about retrieving the product key in Windows 10 or Windows 8 itself
Open a new command prompt window (cmd.exec) and type the following command:
wmic path softwarelicensingservice get OA3xOriginalProductKey
Find Windows 10 OEM product key using CMD app (cmd.exec)
Conclusion
You learned how to find your embedded Windows 8 or Windows 10 OEM product key from a Linux command line option or when Linux installed.
🐧 Get the latest tutorials on Linux, Open Source & DevOps via
Источник
SSH on Windows Subsystem for Linux (WSL)
In this tutorial, you will learn how to enable SSH on Windows Subsytem for Linux (WSL) and have SSH server start automatically at boot
Prerequisite:
- Windows 10 version 1703 (Creators Update) or higher
- Windows Subsystem for Linux Enabled
- This Tutorial use the Ubuntu distro
Level of Difficulty: Beginner
Estimate Time to Complete Tutorial: 5 – 10 mins
Install SSH
To get the ssh server working properly, you must uninstall and then reinstall it using the following command:
- sudo apt remove openssh-server
- sudo apt install openssh-server
Edit the sshd_config
- Edit the sshd_config file by running the command sudo vi /etc/ssh/sshd_config
- In the sshd_config file:
- Change PasswordAuthentication to yes
- Add your login user to the bottom of the file by using this command: AllowUsers yourusername . Don’t forget to replace “yourusername” with your actually username.
- do CTRL+X to save and exit
Start or restart the SSH service
- Check the status of the ssh service:
- service ssh status
- If you see: * sshd is not running
- Then run this command:
- sudo service ssh start
- Then run this command:
- If you see: * sshd is running
- Then run this command:
- sudo service ssh —full-restart
- Then run this command:
Allow SSH service to start without password
- run the command
- sudo visudo
- add the following line
- %sudo ALL=NOPASSWD: /usr/sbin/sshd after %sudo ALL=(ALL:ALL) ALL
You can test that you don’t need a sudo password when you start ssh by running sudo service ssh —full-restart (if ssh is already running) or sudo service ssh start (if ssh is not running)
Add a Windows Task Scheduler to automatically start ssh server
- Open Windows Task Scheduler
- Create a Basic Task
- In the Basic Task Window:
- Under Create Basic Task
- Name : Start Bash SSH Server
- Description: Start the WSL SSh Serer via a bash command
- Click Next to continue
- Under Trigger
- under When do you want the task to start? select When the Computer Starts
- Click Next to continue
- Under Action
- Select Start a Program
- Under Program/script: %windir%\System32\bash.exe
- Under Add arguments (optional): -c «sudo /etc/init.d/ssh start»
- Click Next to continue
- Under Finish
- Make sure all the settings are correct and click Finish to create the Task
- Under Create Basic Task
Test that your Task scheduler is working by:
- Stopping the ssh server in a bash window (if it is already running) by running this command: sudo service ssh start . Make sure that the ssh server has stopped by running this command: service ssh status
- You should see: * sshd is not running
- Run your Task from the Task scheduler
- In your bash window run the command: service ssh status
- You should see : * sshd is running
Enable Port 22 in Windows Firewall
- Open Windows Firewall Advance Settings
- Click on New Rule… under Inbound Rules to create a new firewall rule
- Under Rule Type select Port
- Click Next to Continue
- Under Protocol and Ports select Specific local Ports and enter 22
- Click Next to Continue
- Under Action select Allow the connection
- Click Next to Continue
- Under Profile make sure to only select Domain and Private
- Warning: do not select Public unless you absolutely require a direct connection form the outside world. This is not recommend especially for portable device (Laptop, Tablets) that connect to random Wi-fi hotspots.
- Click Next to Continue
- Under Name
- Name: SSH Server
- Description: SSH Server
- Click Finish
Test SSH Remote Connection
Validate that you can connect to your ssh server by attempting to connect from a remote machine via PowerShell.
Run the command: ssh username@machinename (if you dont have a netbios enabled router, you should use ip address instead of the machine name) to login.
Conclusion
You should now have SSH enabled as a service that automatically starts on boot on your Windows Subsystem for Linux (WSL)
Источник
Can I recover my Windows product key from Ubuntu? [duplicate]
I am struggling right now with using ubuntu and would like some help.
So right now i’m running ubuntu from a USB flash drive after Windows 7 somehow left.
How can I get my windows product key which is somewhere on my laptop hard drive, from within Ubuntu?
2 Answers 2
First recover your Ubuntu with going to recovery mode and running
This answer is not written by me but by Thomas on Superuser, please vote there, if you vote here thanks
There is a great tool available for Linux called chntpw. You can get it easily on Debian/Ubuntu via:
sudo apt install chntpw
To look into the relevant registry file mount the Windows disk and open it like so:
chntpw -e /path/to/windisk/Windows/System32/config/SOFTWARE
Now to get the decoded DigitalProductId enter this command:
dpi \Microsoft\Windows NT\CurrentVersion\DigitalProductId
A comment from below says
The path to the relevant registry file is /path/to/windisk/Windows/System32/config/RegBack/SOFTWARE
So for anyone wondering how this actually works.
Essentially you’ll have to grab the contents of the registry key
This is a so called REG_BINARY . Meaning it’s just a collection of bytes. You could dump them via chntpw or copy them by hand.
Let’s see what we have to do with those bytes in order to get our product key with the help of some pseudo code.
Once you have those in an Array, you need to extract the subset of bytes that encode the product id. In particular: the range between 52 and (52 + 14). That gives you 15 bytes.
This is still a bunch of bytes, that don’t at all resemble the product key. So let us decode it.
For that you need the collection of all the characters a product key can be made of:
Yes this is not the whole alphabet. As it turns out a Windows product key doesn’t use all of the alphanumerical symbols.
Now let’s do the decoding. We’ll need:
- A variable to hold the product key
- A loop over 0 to 24. For each character of our product key
- An inner loop over 0 to 14 (In reverse) For each byte in our encoded id
- Some bit fiddeling and arithmatic for the decoding process
Finally we insert the «-» character into the string at the appropriate places.
Capabilities of our pseudo code
- $array.Range($from, $to) Get the contents of $array from $from to $to
- $array.Insert($where, $what) Insert $what at $where
- FOR $var = $start TO $stop [STEP $step] loop the variable $var from $start to $stop applying $step on each iteration
- $a XOR $b Calculate bit-wise exclusive or on the numbers $a and $b
- $a MOD $b Calculate remainder of the division of $a and $b
- $array[$i] Take only the element at position $i from the array
- #bla bla Is a comment and will be ignored
- Strings are just char arrays.
You can see 3 actual implementations in C#, PowerShell and Python over at Super User
Источник