Mac Terminal: Avoid password
It could be configured to make sudo skip password prompt for specific command with /etc/sudoers.

# modify /etc/sudoers with visudo
# never open it directly with an editor
sudo visudo


Append the following conf into the file,

Cmnd_Alias SHUTDOWN_NOW = /sbin/shutdown -h now
%admin ALL=(root) NOPASSWD: SHUTDOWN_NOW


Done.