Git Product home page Git Product logo

biruhs-hp-laptop's Introduction

Reset your windows Pc password tru SSH

My son getting out of control playing Mortal Kombat 2 on Windows 10 using DosBox. I want to be able to reset the password and shutdown the computer remotely from my phone.

How to

Setup Windows to run ssh server - https://www.concurrency.com/blog/may-2019/key-based-authentication-for-openssh-on-windows

Create your own ssh keypairs (with ssh-keygen) and add them to this directory. Add the public key portion to the c:\ProgramData\ssh\administrators_authorized_keys file on the windows machine.

Copy changepass.cmd file to C:\Users\<username> on the Windows machine. Change the username from me to whatever you have on the windows machine.

Replace the IP address of your machine with the one in hp.sh file. Replace the username as well.

Run a docker-compose docker-compose up -d

Login to http://docker-host:8070 try resetting the password. You should see something like this at the top

got your password aaa
me@DESKTOP-D7KOOUE C:\Users\me>rem timeout 10 

me@DESKTOP-D7KOOUE C:\Users\me>setlocal enabledelayedexpansion 
"setting password to aaa"
The command completed successfully.

Benefits

  • Peace of mind when you are sleeping - reach out your phone and just reset the password.
  • You dont have to know the currrent password to reset since it works with ssh key auth.

Update

  • Added a function to enable and disable Internet access as well. I use Shorewall on Linux machine as my router. Ping me if you need the configs for shorewall.

biruhs-hp-laptop's People

Contributors

awolde avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.