SSH-scripting, a noob question.

Discussion in 'Mac Programming' started by Jiddick ExRex, Oct 13, 2007.

  1. Jiddick ExRex macrumors 65816

    Jiddick ExRex

    Joined:
    May 14, 2006
    Location:
    Roskilde, DK
    #1
    Why won't the rest of the script execute beyond the ssh connection of this script?

    I am prompted for pw which I provide and then I just get to the home folder.
    I also did a 'chmod +x testScript-sh' btw.
     
  2. sord macrumors 6502

    Joined:
    Jun 16, 2004
    #2
    The program does not continue because touch won't execute until SSH completes (meaning touch will run on the local computer, not the remote). You can't script like that with SSH.

    If you look at 'man ssh', you will see you can pass commands at the end of your SSH command. You will want to setup your SSH keys (http://pkeck.myweb.uga.edu/ssh/) so that you can SSH without a password, then you can "ssh admin@administrators-computer.local touch key" and "ssh admin@administrators-computer.local ls -l" I believe.
     
  3. Jiddick ExRex thread starter macrumors 65816

    Jiddick ExRex

    Joined:
    May 14, 2006
    Location:
    Roskilde, DK
    #3
    Thank you, that was just the suspicion I needed to be confirmed. Thanks a lot!
     

Share This Page