Is there a way to avoid the password prompt in pg_basebackup?
Create a .pgpass in the home directory for the postgres user, or whatever user you run pg_basebackup as.

Link to the manual: http://www.postgresql.org/docs/current/static/libpq-pgpass.html