Closed notoriou1pig closed 3 months ago
You get the authentication error because PAM doesnt allow you to change passwords for other users (this would be a security risk).
Just like the comment in the code says, you need to run as root if you want to change another users password.
This is not unique to this implementation of PAM, you get the same if you try to do the same in C (or any other language).
Thank you for your quickness.
I got it, what about the same user.
When my user user
run the same python line, it does the same.
But I suppose my current user could change its own password no ?
Yes, in theory. I am not a PAM expert and I havent yet found an example that manages to do that as the current user. For example the "passwd" utility uses the setuid bit so that it always runs as root. There are problems with the access rights in the /etc folder which usually makes it easier to run the process as root (which of course need to be done with cautious)
Okay, I checked the passwd
utility and yep, it use the setuid bit.
Anyway, I'll find another solution. (Certainly something with the setuid bit).
Thanks a lot for your time. You can close this issue if you want. notoriousPig
Hello,
I try to use this pamela module to change user password. It work great for the current user.
In the source code, there is this comment saying (Line 409) :
I tryied to add a "current_password" in table containing the passwords in the new_simple_password_conv call :
I do not understand why it still does not work. It throw :
pamela.PAMError: [PAM Error 20] Authentication token manipulation error
As if passwords were not good. In my debug, I can see thatcurrent_password
seems right because I go to the next step (new UNIX password
prompt).Here is my call :
pamela.change_password("user", "oldPass", "newPass", service="passwd")
And here is my outpout :Is there a way to get more debug info ? Or do you have any idea on what could happen ? Thanks in advance, I can provide more file if needed.
notoriousPig