Create and execute a shell script (SSH) on controller

I am having trouble to get a Linux shell script to execute on a 750-8212 controller through SSH. Can this be done? If so, where is a proper place on the controller file system for a shell script? The script only needs to run once.

Some additional background information:
So far I have tried the SD card but setting the execute bit fails. This might be due to a limitation of the file system on the card (fat32). The home directory for the admin user seems not fitting. It symlinks to the codesys_root directory. This does not seem like a proper location to me. Also, admin is not allowed to transfer files via ftp to that location anyway. The noexec setting in fstab can also be related.

For anyone running into a similar situation: it seems /usr/local/bin is a fitting location for custom shell scripts to execute via ssh on a controller.

The controller does not permit ftp write access into /usr/local/bin. The following steps did work:

  1. use ftp to copy the script file(s) to the controller sd card
  2. use ssh (as root) to move the script file(s) from sd card to /usr/local/bin
  3. use ssh to set the execution bit (i.e. chmod a+x myfancyscript.sh)
  4. use ssh to execute the script file(s), either as root or admin

Of course this will not work if there is no SD card in the controller. In my case a large number of files on the SD card had to be manipulated, which implies the presence of an SD card.