I ssh from my iMac to the Pi on a daily basis (although I long ago set private keys - so never use password).
macOS is quite properly objecting to a potential security breach.
This is fundamentally a macOS problem, but you can do a few things on the Pi to make it easier - and you should always do these anyway :-
Set a new password on the Pi - it should ...
I am assuming you have the source code of your C program. If so, add these lines:
At the top:
Near the start of main():
if (setuid(getuid()) < 0)
printf("Privilege change failed\n");
You can use any other error notification, instead of the printf.
See man -...