smbpasswd command not found on MacOS High Sierra

I need to change my Active Directory password at my office, we have documentation on linux to use smbpasswd command line. On Debian, this command can be found in samba-common-bin. I wish I could switch my password from MacOS but I can't find smbpasswd command.


Active Directory uses Kerberos for all authentication and supports the password-change protocol, so you should be able to directly use kpasswd user@REALM instead.


As a workaround, I found I could just run on linux, inside docker! I found dperson/samba which contains the compiled smbpasswd command. No need to try to setup samba on MacOS anymore ;)

docker run --rm -it dperson/samba \
bash -c "smbpasswd -U my_activedirectory_username -r 10.x.y.z"

Or if you like doing things on your own like I did, here's a debian Dockerfile which installs samba-common-bin:

FROM debian:latest

RUN apt-get update && apt-get install -y \
  samba-common-bin

Then you can build and run that docker file

docker build . -t example/debian-samba-common-bin
docker run --rm -it example/debian-samba-common-bin \
bash -c "smbpasswd -U my_activedirectory_username -r 10.x.y.z"

I published the above to github.com/GabLeRoux/docker-debian-samba-common-bin, so you can do this:

docker run --rm -it gableroux/debian-samba-common-bin \
  bash -c "smbpasswd -U my_activedirectory_username -r 10.x.y.z"

🎉