You can execute shell scripts remotely(ssh) before and after build. First you should define SSH hosts on hudson global config page. After that you can refer to this hosts using select list.