Bash script and remote server issue

Hello,

I'm attempting to run a script on a remote server via SSH but am having issues getting the script to run using proprietary binaries located on the remote server as it keeps complaining that commands are invalid on the local machine. If I run the script locally on the remote server, it works just fine. What am I doing wrong?

 ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o ConnectionAttempts=999999 -o ConnectTimeout=10 -i key -l root $ip 'bash -s' < script.sh

Thanks

So you're telling us that if you log in as root to $ip , your shell is bash , and you can run/source script.sh to satisfaction and your line above does not? What be the error msgs? What does "commands are invalid" mean? Did you try to strip off all those ssh options and parameters when trying that line?

the only way the proprietary binaries are going to run locally on your local server is if the shell has access to them locally either through a local copy on the server itself or a samba/nfs shared directory from the remote server ...

if you do not want or not allowed to copy the proprietary binaries from the remote server to the local server or cannot do a samba/nfs share, your best bet -- assuming you only want to run your script on the remote server -- is to just call the remote script through ssh (see below) ... you just need to make sure you have the correct path to the script and whatever commands you need ...

 ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o ConnectionAttempts=999999 -o ConnectTimeout=10 -i key -l root $ip "/bin/bash -s < /dir/script.sh"