How to allow user to reset password?
-
Hi,
I wanted to know if there is a method to allow EndUser to reset password that we set in Config? Is there a way to write a macro , or update DWC to take user input and save new password(M551) in override file using M500? Basically I am asking if and End user has a method to reset without the hassle of looking into config file and changing?
@chrishamm @dc42 : As far as I understand, there isn't such method, However can something to address this be done in the software? Any suggestions? -
@jayt if you have physical access it's quite easy to reset the password. For example if you connect USB to the board and then send an M551 over it, the configured one is replaced - at least til the machine is restarted.
-
@chrishamm : Ok, if that works, still a Power cycle will delete the new password and revert to the one in config.
@dc42 : Can you check if M500 can override for this ?
Or
can we use a file to read the password? That way a user can set their own string of allowed PAssword format and the instruction M551 can read password from there ? -
@jayt Yes, correct. You could store a password command in e.g.
/sys/password.g
and always invoke it from config.g (M98 P"password.g"
). Then you could erase it again by sending something likeecho >/sys/password.g "M551 P"""""
from USB. -
@chrishamm : Thanks Chris, this appears to be a good solution. So can you confirm the sequence below ?
- M98 P"password.g" -> to be included in Config
- echo >/sys/password.g "M551 P"new password" "
- Do I need to use USB connection for this ? IF i connect via DWC using ethernet, and send command (2) from console, will that work?
- If i write Point -2 in a macro say "RESET.g" something like below, will that work ??
PasswdRESET.g
var new_passwd = echo > /sys/newpasswdstring;
echo >/sys/password.g "M551 P {var.newpasswd}"==================
-
@jayt Not entirely:
- Correct
- Use
echo >/sys/password.g "M551 P""new password"""
instead. In strings, double-quotes"
must be expressed as""
- Only if you're logged in
- If you use proper escaping, yes:
PasswdRESET.g:
M551 P{param.S} echo >/sys/password.g "M551 P""" ^ param.S ^ """"
Then invoke it via
M98 P"PasswdRESET.g" S"myNewPassword"
. -