Professional Web Applications Themes

command execution upon ssh - Debian

question that should be easy, but that i can't turn up with a little man-page reading: i want to ssh to a remote machine (firewall), and then immediately upon success, ssh to another remote machine. i don't want to put this in my .login, because i don't want it to always happen -- i want to be able to *just* ssh to the first box, too, or have the option of going through to the 2nd. it seems this should have to do with the '-n' option for ssh. but trying `ssh -n machine1 ssh machine2` gave me the error: ...

  1. #1

    Default command execution upon ssh

    question that should be easy, but that i can't turn up with a little
    man-page reading:

    i want to ssh to a remote machine (firewall), and then immediately
    upon success, ssh to another remote machine. i don't want to put this
    in my .login, because i don't want it to always happen -- i want to be
    able to *just* ssh to the first box, too, or have the option of going
    through to the 2nd.

    it seems this should have to do with the '-n' option for ssh. but
    trying `ssh -n machine1 ssh machine2` gave me the error:

    Pseudo-terminal will not be allocated because stdin is not a terminal.

    so a little googling turned up the -t flag, and `ssh -t -n machine1
    ssh machine2` seems to do the job.

    however (here's the problem), i can't type in the resultant terminals.
    oops.

    how can i fix this? it would be great to have this capability ...

    thanks,

    </nori>

    --
    .~. nori sccs.swarthmore.edu
    /V\ [url]http://www.sccs.swarthmore.edu/~nori/jnl/[/url]
    // \\ maenad.net
    /( )\ [url]www.maenad.net[/url]
    ^`~'^
    get my (*new*) key here:
    [url]http://www.maenad.net/geek/gpg/7ede5499.asc[/url]
    (please *remove* old key 11e031f1!)


    --
    To UNSUBSCRIBE, email to [email]debian-user-requestlists.debian.org[/email]
    with a subject of "unsubscribe". Trouble? Contact [email]listmasterlists.debian.org[/email]
    nori heikkinen Guest

  2. #2

    Default Re: command execution upon ssh

    On Wed, Jul 02, 2003 at 12:21:20PM -0400, nori heikkinen wrote:
    [...]
    } so a little googling turned up the -t flag, and `ssh -t -n machine1
    } ssh machine2` seems to do the job.
    }
    } however (here's the problem), i can't type in the resultant terminals.
    } oops.
    }
    } how can i fix this? it would be great to have this capability ...

    The -n option is exactly the problem. You have told it to close its stdin,
    but yet you want it to read what you're typing on stdin. Take out the -n.
    What on earth made you put it in to begin with?

    } thanks,
    } </nori>
    --Greg


    --
    To UNSUBSCRIBE, email to [email]debian-user-requestlists.debian.org[/email]
    with a subject of "unsubscribe". Trouble? Contact [email]listmasterlists.debian.org[/email]
    Gregory Seidman Guest

  3. #3

    Default Re: command execution upon ssh

    nori heikkinen <norisccs.swarthmore.edu> writes:
    > i want to ssh to a remote machine (firewall), and then immediately
    > upon success, ssh to another remote machine. i don't want to put this
    > in my .login, because i don't want it to always happen -- i want to be
    > able to *just* ssh to the first box, too, or have the option of going
    > through to the 2nd.
    I'd do 'ssh -t machine1 ssh machine2'.
    > it seems this should have to do with the '-n' option for ssh.
    From ssh(1):

    -n Redirects stdin from /dev/null (actually, prevents
    reading from stdin). This must be used when ssh is run
    in the background.

    I do occasionally find this useful, but it means that you will be
    unable to interact with the ssh session, which isn't what you want at
    all.
    > however (here's the problem), i can't type in the resultant terminals.
    ....because you've told ssh that you don't want to be able to, with
    -n. Try leaving that out.

    (As the man page notes, -nf are useful options for running remote X
    applications; for pseudo dual-head operation at work, for example, I
    do 'ssh -nf laptop x2x -to :0.0 -east' all the time. ssh asks me for
    a password, then backgrounds itself, and I never hear from it again in
    spite of the X forwarding continuing to work.)

    --
    David Maze [email]dmazedebian.org[/email] [url]http://people.debian.org/~dmaze/[/url]
    "Theoretical politics is interesting. Politicking should be illegal."
    -- Abra Mitchell


    --
    To UNSUBSCRIBE, email to [email]debian-user-requestlists.debian.org[/email]
    with a subject of "unsubscribe". Trouble? Contact [email]listmasterlists.debian.org[/email]
    David Z Maze Guest

  4. #4

    Default Re: command execution upon ssh

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    On Wed, Jul 02, 2003 at 12:21:20PM -0400, nori heikkinen wrote:
    > i want to ssh to a remote machine (firewall), and then immediately
    > upon success, ssh to another remote machine. i don't want to put this
    > in my .login, because i don't want it to always happen -- i want to be
    > able to *just* ssh to the first box, too, or have the option of going
    > through to the 2nd.
    ssh -C -X -c 'ssh -C -X <second host>' <first host> should do
    something approximately what you're looking for.
    > it seems this should have to do with the '-n' option for ssh.
    - -n means "No terminal." I've never found it useful.
    > however (here's the problem), i can't type in the resultant terminals.
    > oops.
    > how can i fix this? it would be great to have this capability ...
    Avoid -n until you've got a clear need for it.

    - --
    .''`. Paul Johnson <balooursine.ca>
    : :' : proud Debian admin and user
    `. `'`
    `- Debian - when you have better things to do than fix a system
    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.2.2 (GNU/Linux)

    iD8DBQE/BAzLJ5vLSqVpK2kRArP/AJ49yWQFmMFZzaz8wgqH2gzdyuPlEACgg65/
    6oFUhMAmZvWw7NeKG2zdHdI=
    =uHiE
    -----END PGP SIGNATURE-----


    --
    To UNSUBSCRIBE, email to [email]debian-user-requestlists.debian.org[/email]
    with a subject of "unsubscribe". Trouble? Contact [email]listmasterlists.debian.org[/email]
    Paul Johnson Guest

Similar Threads

  1. Acrobat 6.01: File Command disappears on Command Bar
    By Charles_Foskett@adobeforums.com in forum Adobe Acrobat Windows
    Replies: 1
    Last Post: May 5th, 02:58 PM
  2. RUN/execute a Command-Line command from an ASP page
    By Lucas Cowald in forum ASP.NET Building Controls
    Replies: 1
    Last Post: October 22nd, 04:26 PM
  3. RUN/execute a Command-Line command from an ASP page.
    By Lucas Cowald in forum ASP Components
    Replies: 7
    Last Post: October 22nd, 01:08 PM
  4. Windows Explorer Right Click Command (+ Custom Command Script)
    By lennySydney webforumsuser@macromedia.com in forum Macromedia Fireworks
    Replies: 1
    Last Post: September 6th, 07:59 PM
  5. Replies: 1
    Last Post: August 19th, 02:26 AM

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
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139