Navigation

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

    Lost password after reboot

    General pfSense Questions
    3
    4
    717
    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.

        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

            Products

            • Platform Overview
            • TNSR
            • pfSense
            • Appliances

            Services

            • Training
            • Professional Services

            Support

            • Subscription Plans
            • Contact Support
            • Product Lifecycle
            • Documentation

            News

            • Media Coverage
            • Press
            • Events

            Resources

            • Blog
            • FAQ
            • Find a Partner
            • Resource Library
            • Security Information

            Company

            • About Us
            • Careers
            • Partners
            • Contact Us
            • Legal
            Our Mission

            We provide leading-edge network security at a fair price - regardless of organizational size or network sophistication. We believe that an open-source security model offers disruptive pricing along with the agility required to quickly address emerging threats.

            Subscribe to our Newsletter

            Product information, software announcements, and special offers. See our newsletter archive to sign up for future newsletters and to read past announcements.

            © 2021 Rubicon Communications, LLC | Privacy Policy