SOLVED Changing root password for over 50 freenas 11u3 devices.

Rainer

Cadet
Joined
Oct 13, 2021
Messages
3
recently rotated root passwords on all of our devices, using sshpass with pw redirect of new password.
Code:
sshpass -p Curpassword ssh root@freenas01.domain.com 'echo "NEWpassword" | pw usermod root -h 0' 

the result is that it changes the password for ssh/shell login, but cant login to GUI/webui with NEWpassword, and have to use old one.
I have tried doing it manually via shell usuing passwd and same issue.
Is there a way i can rotate/change root password from shell for webui root access?
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
Try midclt call user.update '{"username":"root","password":"<new password string>"}'.
 

Rainer

Cadet
Joined
Oct 13, 2021
Messages
3
@Samuel Tai
thanks for the prompt response. I am getting the following error
Code:
# midclt call user.update '{"username":"root","password":"NEWpassword"}'         
update() missing 1 required positional argument: 'data'
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/middlewared/main.py", line 130, in call_method
    io_thread=False)
  File "/usr/local/lib/python3.7/site-packages/middlewared/main.py", line 1084, in _call
    return await methodobj(*args)
TypeError: update() missing 1 required positional argument: 'data'
 
Top