pdbedit は -t を指定すると標準入力からパスワードを読み込む。 パスワードは改行区切りで2回出力する。
echo -e "password\npassword" | pdbedit -a -t -u foo_user