Welcome to LQ.
All of the commands that you place in your bash script will be run on the local box so it is trying to cd and rm on your machine. To run a command on a remote box you can use the syntax:
ssh user@host command
If you want to run a whole script on a remote box then a good technique is to upload the script that is to be run remotely to a web server. Then when you execute the ssh command - use:
ssh user@host "wget -qO -
http://www.yourhost.com/script.sh | sh"
This will download "script.sh" and run it on the server that you ssh to. This is also quite useful for automatic updates as you can schedule the wget command using cron.