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

    Change users password

    Development
    3
    4
    1.4k
    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.
    • M
      Maktist
      last edited by

      Hello,

      I need to change my users password on command line, to put it in a script, passwd does not work for me. can you help me please.

      thnx

      1 Reply Last reply Reply Quote 0
      • M
        Maktist
        last edited by

        UP !!
        Need help plz

        1 Reply Last reply Reply Quote 0
        • ?
          Guest
          last edited by

          From /etc/inc/auth.inc:

          /* root user special handling */
          	if ($user_uid == 0) {
          		$cmd = "/usr/sbin/pw usermod -q -n root -s /bin/sh -H 0";
          		if($debug)
          			log_error(sprintf(gettext("Running: %s"), $cmd));
          		$fd = popen($cmd, "w");
          		fwrite($fd, $user['password']);
          		pclose($fd);
          	}
          
          1 Reply Last reply Reply Quote 0
          • G
            Gambler
            last edited by

            @Amirkabir:

            From /etc/inc/auth.inc:

            /* root user special handling */
            	if ($user_uid == 0) {
            		$cmd = "/usr/sbin/pw usermod -q -n root -s /bin/sh -H 0";
            		if($debug)
            			log_error(sprintf(gettext("Running: %s"), $cmd));
            		$fd = popen($cmd, "w");
            		fwrite($fd, $user['password']);
            		pclose($fd);
            	}
            

            ive tried but it does not work

            1 Reply Last reply Reply Quote 0
            • First post
              Last post
            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.