Thursday, August 29, 2024

Using Devcon to Clear Putty’s “Access Is Denied” Message Without a Reboot

Issue:

Occasionally, after connecting to a USB to UART bridge, you may encounter an "Access is denied" error when launching PuTTY after a successful previous session. Restarting Windows can temporarily resolve this issue, but the error tends to recur. I believe it's happening because the port is still being hung open despite the closing of PuTTY.

Interesting read:
https://stackoverflow.com/questions/20058542/is-it-possible-to-generate-a-deadlock-with-single-lock



Resolution:

Disabling and enabling the device in Device Manager doesn't seem to resolve the issue. However, you can fix it by running the following command in devcon, as long as you know the specific device you're targeting.

1. List all USB devices that are currently connected to the machine:

devcon.exe find *USB*



2. Identify the device you're looking to toggle:

USB\VID_10C4&PID_EA60\0001                                  : Silicon Labs CP210x USB to UART Bridge (COM3)


3. Make sure PuTTY is closed at this point!

4. Disable and enable the device using devcon.exe:

devcon.exe disable "USB\VID_10C4&PID_EA60*"
devcon.exe enable "USB\VID_10C4&PID_EA60*"

5. Open PuTTY and try connecting to COM3 again.




πŸ‘½

Wednesday, August 21, 2024

Debian - Reset Any User Password


Procedure:

1. Connect file system to another Debian machine

2. Mount file system and verify:
  1. lsblk (find sdx1 device)
  2. sudo mkdir /mnt/microsd
  3. sudo mount /dev/sdx1 /mnt/microsd
  4. ls /mnt/microsd
3. Open shadow file in nano
  1. sudo nano /mnt/microsd/etc/shadow
4. The file is /etc/shadow, there will be lines like:

user:asdfasdfasdf$$$$asdfasdfasdfsadfasdf::17178:0:98899:7:::

5. You must remove the fist field between : and :

user:THIS_IS_WHAT_WAS_REMOVED:17178:0:98899:7:::

6. Unmount the file system from the rescue machine.

  1. umount /mnt/microsd

7. Reconnect to target OS via serial.

8. Boot and login with root.

9. Change password with passwd.





πŸ‘½