Menu

#1 How to run command after login

closed
nobody
None
5
2010-02-20
2010-02-20
No

I have a server that cannot be connected to from an external IP. It only allows SSH connections from within the local network.

To connect to it, I normally SSH to a server that does have external SSH support. Then from it, I SSH to the internal server.

I'd like to configure a quick way to SSH to the internal server. To test this out, I've set up ssh keys so that I can connect between the servers without a password. So using SSHMenu, I created a host with this in the "hostname" field:

me@external.server "ssh server.behind.firewall"

However, this opens up a terminal with the following message:

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

If I change the hostname to the following:

me@external.server "ssh -t -t server.behind.firewall"

Then, I can get in and get a command prompt. So it works! However, I get this error message:

tcgetattr: Invalid argument

It isn't a big deal, but if I can get rid of it, I'd like to. Is this the right way to do what I'm trying, or is there a better approach?

Thanks,
Tauren

Discussion

  • Grant McLean

    Grant McLean - 2010-02-20

    I think you just need to add the -t to the initial SSH connection to external.server:

    -t me@external.server "ssh server.behind.firewall"

    But, you should take a look at this article which describes how to set up your config so that the intermediate connection is transparent:

    http://sshmenu.sourceforge.net/articles/transparent-mulithop.html

    This is standard SSH config rather than SSHMenu-specific.

    Cheers
    Grant

     
  • Grant McLean

    Grant McLean - 2010-02-20
    • status: open --> closed
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.