0

I need to access to remote computer and I have username and password, but I can access only from third computer ( like proxy, I also have credentials for third computer). WhenI start project, from code I execute some commands via ssh ( I am trying to connect to second). Is possible to make terminal to automatically connect through third when I execute code (ssh connect to third to be automatic) ?

Damir
  • 229

3 Answers3

0

As an outline, you'd need to set the second PC to setup an SSH connection to the third when you execute your code. You might also want to somehow forward your commands through to the third PC, if that's what you're trying to do. (Forgive me, this is off the top of my head :P )

0

Uh.. I am going out on a limb here. I am wondering if maybe adding some commands to the second computer's ~/.bashrc file might help you out.

When you login to the second box as a specific user the commands in the bashrc file will be executed. In theory you could setup a non-interactive ssh login to the third computer.

The only thing that I would wonder is whether your program that your are working on would be able to jump through the connections and get to the third computer. What you may have to do instead if create an ssh tunnel. But that is a whole other topic.

0

You could login through ssh to your second computer, and after logged in, connect from that terminal to the third one. Or, to make the second computer automatically redirect to the third one, using either tunneling or port forwarding

Cornel
  • 156