Sergii P
Sergii P

Reputation: 710

Changing Mac OS user password programmatically using C++

I'm trying to change local user password on MacOS Catalina using C++. Is there a way to do it?

Upvotes: 0

Views: 204

Answers (1)

L. Scott Johnson
L. Scott Johnson

Reputation: 4382

UNTESTED: If you're running with permissions to do so, you can use

system("security set-keychain-password -o oldpassword -p newpassword /Users/username/Library/Keychains/login.keychain");

Upvotes: 1

Related Questions