• How to run a .sh from afar?

    From Avon@21:1/101 to All on Sat Nov 4 23:54:56 2017
    I have a linux box running ubuntu and it has a samba enabled folder
    containing a process.sh that I wish to be able to access and run from my raspberry pi over a LAN. Ideally I would like to be able to copy a file into the Ubuntu folder from the Pi first then run the process.sh script on the Ubuntu box to process it.

    Is that possible? I'm trying to figure out how best to access the folder from the Pi and also how to run scripts remotely using a script on the Pi.

    Another scenario is to try and call the script from my windows 7 box but although I can see the folder and the process.sh within it I'm stuck trying
    to get to a point whereby I can run that script on the Ubuntu box from the windows machine. I did find a pushd command that I could call from windows command prompt to allow access to the networked share folder but that's as
    far as I got. running the .sh was not working :(

    Best, Paul

    --- Mystic BBS v1.12 A36 (Windows/32)
    * Origin: Agency BBS | telnet://agency.bbs.geek.nz (21:1/101)
  • From NuSkooler@21:1/121 to Avon on Sat Nov 4 10:01:06 2017
    On Saturday, November 4th Avon muttered...
    I have a linux box running ubuntu and it has a samba enabled folder containing a process.sh that I wish to be able to access and run from my raspberry pi over a LAN. Ideally I would like to be able to copy a file into the Ubuntu folder from the Pi first then run the process.sh script

    Enable SSH access on the Ubuntu machine if you have not already. Then, you have
    multiple options:
    1) You can ssh to the box (e.g. from the Pi or from Windows via PuTTY, etc.)
    and execute the script
    2) Again with ssh, can simply remotely execute the script:
    ssh username@remotemachine /path/to/process.sh
    (you can do this via Windows as well; google remote ssh windows)
    3) You can use sshfs to remotely mount a path to your local (pi) box. ...the
    filesystem is as good as local at that point pretty much. Again, you may be able to do this from Windows but I've never tried.

    Hope that helps!



    --- ENiGMA 1/2 v0.0.8-alpha (linux; x64; 6.11.3)
    * Origin: Xibalba -+- xibalba.l33t.codes:44510 (21:1/121)
  • From Vorlon@21:1/195 to Avon on Sun Nov 5 16:32:06 2017
    Hello Avon!

    04 Nov 17 23:54, you wrote to all:

    I have a linux box running ubuntu and it has a samba enabled folder containing a process.sh that I wish to be able to access and run from
    [...]
    could call from windows command prompt to allow access to the
    networked share folder but that's as far as I got. running the .sh was
    not working :(

    simple, when you know how:

    sudo mount.cifs //192.168.1.254/share /home/vorlon/tmp





    Vorlon


    --- GoldED+/LNX 1.1.5-b20161221
    * Origin: Dragon's Lair ---:- dragon.vk3heg.net -:--- (21:1/195)
  • From bcw142@21:1/145.5 to Avon on Sun Nov 5 08:27:54 2017
    On 11/04/17, Avon said the following...
    I have a linux box running ubuntu and it has a samba enabled folder containing a process.sh that I wish to be able to access and run from my raspberry pi over a LAN. Ideally I would like to be able to copy a file into the Ubuntu folder from the Pi first then run the process.sh script
    on the Ubuntu box to process it.

    Is that possible? I'm trying to figure out how best to access the folder from the Pi and also how to run scripts remotely using a script on the
    Pi.

    I'm sure it's possible, but not as easy as ssh. I use rsync to do that
    between Linux versions (Pi is a Linux version). Even that can be done easier with filezilla which has sftp (Secure FTP). SSH encrypts everything so can be used over the net. If you want scripts, here's one I use on Ubuntu to get things from the BBS on the Pi:
    #!/bin/bash
    # get from dmz /mystic to here
    rsync -aPrvz "-e ssh -p 2222" pi@dmz:/mystic/"$1" .

    The "-e ssh -p 2222" is because I moved the ssh port from 22 to 2222 to keep
    it out of mysitc's way. You need to edit (as root) /etc/ssh/sshd_config:
    # What ports, IPs and protocols we listen for
    Port 2222

    After that you need to restart for it to take effect with:
    sudo service ssh start

    Another scenario is to try and call the script from my windows 7 box but although I can see the folder and the process.sh within it I'm stuck trying to get to a point whereby I can run that script on the Ubuntu box from the windows machine. I did find a pushd command that I could call from windows command prompt to allow access to the networked share
    folder but that's as far as I got. running the .sh was not working :(

    As noted putty is the best way to get to Linux from windows to run the script. There is also Filezilla for the PC/Linux/Mac...
    SSH lets you get at all files, not just shares.

    --- Mystic BBS v1.12 A36 (Linux/32)
    * Origin: BCW Livingroom (21:1/145.5)
  • From Tony Langdon@21:1/143 to NuSkooler on Fri Nov 10 22:24:50 2017
    NuSkooler wrote to Avon <=-

    On Saturday, November 4th Avon muttered...
    I have a linux box running ubuntu and it has a samba enabled folder containing a process.sh that I wish to be able to access and run from my raspberry pi over a LAN. Ideally I would like to be able to copy a file into the Ubuntu folder from the Pi first then run the process.sh script

    Enable SSH access on the Ubuntu machine if you have not already. Then,
    you have
    multiple options:
    1) You can ssh to the box (e.g. from the Pi or from Windows
    via PuTTY, etc.) and execute the script
    2) Again with ssh, can simply remotely execute the script:
    ssh username@remotemachine /path/to/process.sh
    (you can do this via Windows as well; google remote ssh
    windows)
    3) You can use sshfs to remotely mount a path to your local
    (pi) box. ...the filesystem is as good as local at that point pretty
    much. Again, you may be able to do this from Windows but I've never
    tried.

    Or you can use smbclient to copy the file (if it's still around) or mount the filesystem using mount -t cifs (followed by the correct parameters - username, password, etc).


    ... 24 hours in a day, 24 beers in a case. Coincidence?
    ___ MultiMail/Win32 v0.49

    --- Mystic BBS/QWK v1.12 A35 (Raspberry Pi/32)
    * Origin: The Bridge - bridge.vkradio.com (21:1/143)