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

Change users password

Scheduled Pinned Locked Moved Development
4 Posts 3 Posters 1.4k Views
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 Nov 14, 2013, 3:25 PM

    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 Nov 27, 2013, 3:39 PM

      UP !!
      Need help plz

      1 Reply Last reply Reply Quote 0
      • ?
        Guest
        last edited by Dec 30, 2013, 9:30 PM

        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 Feb 3, 2014, 7:12 PM

          @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.
            This community forum collects and processes your personal information.
            consent.not_received