automatically log into secure shell



How do I create a script to automatically log into secure shell?

I tried this on Unix and it didn't work:

echo mypassword | ssh me@xxxxxxxxxx

Thanks.

.