When you try to send sudo command via ssh, I got this message.
sudo: no tty present and no askpass program specified
There are some entries that says you should comment out "Defaults requiretty" from /etc/sudoers, however, there is no such line in the file for Ubuntu 10.04.
Writing "Defaults visibletty" works fine although you password will be visible when you type.
It didn't sound the best solution and I found out that using "-t" option for ssh command is better way. Then the command will be something like this.
ssh -t [address] sudo shutdown -h now
Writing the following like in "/etc/sudoers" will let you "sudo" without prompting password request.
username ALL=NOPASSWD: ALL