Duet3D Logo Duet3D
    • Tags
    • Documentation
    • Order
    • Register
    • Login

    How to allow user to reset password?

    Scheduled Pinned Locked Moved
    Duet Web Control
    2
    6
    604
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • JayTundefined
      JayT
      last edited by

      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?

      chrishammundefined 1 Reply Last reply Reply Quote 0
      • chrishammundefined
        chrishamm administrators @JayT
        last edited by chrishamm

        @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.

        Duet software engineer

        JayTundefined 1 Reply Last reply Reply Quote 1
        • JayTundefined
          JayT @chrishamm
          last edited by

          @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 ?

          chrishammundefined 1 Reply Last reply Reply Quote 0
          • chrishammundefined
            chrishamm administrators @JayT
            last edited by

            @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 like echo >/sys/password.g "M551 P""""" from USB.

            Duet software engineer

            JayTundefined 1 Reply Last reply Reply Quote 2
            • JayTundefined
              JayT @chrishamm
              last edited by

              @chrishamm : Thanks Chris, this appears to be a good solution. So can you confirm the sequence below ?

              1. M98 P"password.g" -> to be included in Config
              2. echo >/sys/password.g "M551 P"new password" "
              3. 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?
              4. 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}"

              ==================

              chrishammundefined 1 Reply Last reply Reply Quote 0
              • chrishammundefined
                chrishamm administrators @JayT
                last edited by

                @jayt Not entirely:

                1. Correct
                2. Use echo >/sys/password.g "M551 P""new password""" instead. In strings, double-quotes " must be expressed as ""
                3. Only if you're logged in
                4. 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".

                Duet software engineer

                1 Reply Last reply Reply Quote 1
                • XYZ_123undefined XYZ_123 referenced this topic
                • First post
                  Last post
                Unless otherwise noted, all forum content is licensed under CC-BY-SA