Navigation

    Netgate Discussion Forum
    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search

    Lost password after reboot

    General pfSense Questions
    3
    4
    725
    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.
    • A
      aayllon last edited by

      Hello.

      In my pfsense server I have wrote a cron script that change the ssh password for admin and root users every month, but for any reason every time I reboot the server, changes are lost, and the only way I have to access through  the ssh console is using the same password I use to access the web interface.

      The script uses next commands to change password:

      system "$echo $passwd |pw mod user root -h 0";
      system "$echo $passwd |pw mod user admin -h 0";

      Can anybody explain me how I can change ssh password and avoid lost changes when the server is rebooted ?

      Thanks a lot.

      1 Reply Last reply Reply Quote 0
      • jimp
        jimp Rebel Alliance Developer Netgate last edited by

        Change the password for admin in the GUI and that changes it for admin/root in the shell. That's the way it's intended to work. Any change that causes a resync of the users, such as a reboot, will overwrite any manual modifications you have made to the accounts in the shell.

        Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

        Need help fast? Netgate Global Support!

        Do not Chat/PM for help!

        1 Reply Last reply Reply Quote 0
        • A
          aayllon last edited by

          Thanks a lot for your reply Jimp,

          Perhaps could you explain me if there any way to use /usr/local/www/system_usermanager_passwordmg.php to change password  through shell console?

          Will be great if I could find any way to change  password from command shell.

          Thanks.

          1 Reply Last reply Reply Quote 0
          • stephenw10
            stephenw10 Netgate Administrator last edited by

            Somehow using the php/develper shell? Or via similar commands? The issue maybe that the password is held as a hash in the config file so you can't operate on it directly like you can with other settings in the file.

            https://doc.pfsense.org/index.php/Using_the_PHP_pfSense_Shell

            Steve

            1 Reply Last reply Reply Quote 0
            • First post
              Last post