Results 1 to 6 of 6

Thread: bash script : ssh + rdesktop

  1. #1
    Join Date
    Nov 2006
    Location
    London
    Beans
    94
    Distro
    Ubuntu 10.10 Maverick Meerkat

    bash script : ssh + rdesktop

    can someone help me with a simple bash script? i am new to this. i want to start an ssh session (i have generated a key so this does not prompt me for a password).

    #/bin/bash
    ssh me@a.c.org.uk -L 3392:b.c.org.uk:3389
    rdesktop -u me localhost:3392 -f

    when i execute the script it logs into ssh successfully, but only executes rdesktop when i exit the ssh session (which i clearly do not want). after logging in, i want rdekstop to be run in another terminal,

    any help appreciated.

  2. #2
    Join Date
    Sep 2007
    Location
    Brisbane, Australia
    Beans
    11
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: bash script : ssh + rdesktop

    Try this:


    Code:
    #!/bin/bash
    ssh me@a.c.org.uk -L 3392:b.c.org.uk:3389 &
    rdesktop -u me localhost:3392 -f

  3. #3
    Join Date
    Oct 2005
    Location
    Al Ain
    Beans
    8,750

    Re: bash script : ssh + rdesktop

    Uhmmm, this is to connect to Windows RDP?

    If so, then you don't need SSH. RDP is pretty secure. It uses RC4. If you are worried about something that can crack RC4, then you have bigger problems.

  4. #4
    Join Date
    Nov 2006
    Location
    London
    Beans
    94
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: bash script : ssh + rdesktop

    no, I'm connecting to a Linux HPC and need to use SSH. Adding "&" does not work (it does not appear to start ssh session). Any ideas?

  5. #5
    Join Date
    Sep 2007
    Location
    Brisbane, Australia
    Beans
    11
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: bash script : ssh + rdesktop

    Take a look at this guide.

    http://www.g-loaded.eu/2006/11/24/au...g-ssh-tunnels/

    This should help you achieve what you are looking for.

  6. #6
    Join Date
    Nov 2006
    Location
    London
    Beans
    94
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: bash script : ssh + rdesktop

    Thanks. Something like:

    Code:
    #/bin/bash
    ssh -f me@a.c.org.uk -L 3392:b.c.org.uk:3389 sleep 10; rdesktop -u me localhost:3392 -f
    works perfectly. Thread solved.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •