how to execute local shell script on remote servers
===

Hi am having a shell script in my local machine and I have to execute that shell script on remote servers. Yet i have done some steps as follows:

step 1: Paired SSH key from local machine and remote server
step 2: ssh user@hostname 'bash - s' < user_add.sh

***************************************************
I am getting an ERROR:
***************************************************
standard in must be a tty
: command not found
bash: line 4: useradd: command not found
Usage: /etc/init.d/vsftpd {start|stop|restart|condrestart|status}
Only root can do that.
chmod: cannot access `/102/prsuser\r': Permission denied
mkdir: cannot create directory `/102/prov/\r': Permission denied
bash: line 8: useradd: command not found
Only root can do that.
chmod: cannot access `/102/prov/PROV_LIS_RESP_DIR\r': Permission denied
chown: cannot access `/102/prov/\r': Permission denied
bash: line 12: /etc/vsftpd/chroot_list: Permission denied
**********************************************************************
Were root login is cant done normally, We can login as root by switching from normal user account by su - command.

So Here my doubt is how to run the script as a root on remote server and wat script used to switch root account at the starting point within my script(user_add.sh).

Please help me on this to resolve.

regards,
Subash.