# Remote julia with gateway ssh

**URL:** <https://discourse.julialang.org/t/remote-julia-with-gateway-ssh/39457>\
**Category:** Juno\
**Tags:** remote\
**Created:** [May 14, 2020, 10:09am UTC](https://discourse.julialang.org/t/remote-julia-with-gateway-ssh/39457 "2020-05-14T10:09:16Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![HenriDeh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/henrideh/32/8316_2.png) [@HenriDeh](https://discourse.julialang.org/u/HenriDeh)\
**Post date:** [May 14, 2020, 10:09am UTC](https://discourse.julialang.org/t/remote-julia-with-gateway-ssh/39457/1 "2020-05-14T10:09:17Z")

</div>

Hello,

I would like to connect to a computer in my university network with Juno to use a remote session. Currently I’m able to do it using a Ubuntu submachine on my local Windows. The thing is I have to go through a gateway to access any server in the network and the connection to the gateway uses a rsa key file that I have locally stored. I have a .ssh/config file setup with the ProxyCommand.

When I connect it goes like this:

1. I type \> ssh name\_of\_the\_server\_in\_the\_config\_file
2. I am prompted for a password to decrypt the rsa file
3. I am prompted for the password of my remote session

ftp-remote-edit 's open SSH option offers only the possibility of direct ssh connection. Also, I have different usernames on the gateway and my remote machine.  
I don’t know much about networking so ask me questions if I am not clear about what I need.

Many thanks.

---

<div class="post-metadata">

**Author:** ![johnh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/johnh/32/3615_2.png) [@johnh](https://discourse.julialang.org/u/johnh)\
**Post date:** [May 14, 2020, 11:25am UTC](https://discourse.julialang.org/t/remote-julia-with-gateway-ssh/39457/2 "2020-05-14T11:25:20Z")

</div>

To go through a gateway you will use ssh port forwarding.  
Download and run MobaXterm

> **[MobaXterm free Xserver and tabbed SSH client for Windows](https://mobaxterm.mobatek.net/)**
>
> The ultimate toolbox for remote computing - includes X server, enhanced SSH client and much more!

This makes setting up port forwarding VERY easy.  
lease download MobaXterm on your windows laptop and let us know when you have it running.

---

<div class="post-metadata">

**Author:** ![HenriDeh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/henrideh/32/8316_2.png) [@HenriDeh](https://discourse.julialang.org/u/HenriDeh)\
**Post date:** [May 14, 2020, 1:10pm UTC](https://discourse.julialang.org/t/remote-julia-with-gateway-ssh/39457/3 "2020-05-14T13:10:01Z")

</div>

Okay It’s installed. What next ?

---

<div class="post-metadata">

**Author:** ![johnh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/johnh/32/3615_2.png) [@johnh](https://discourse.julialang.org/u/johnh)\
**Post date:** [May 14, 2020, 1:28pm UTC](https://discourse.julialang.org/t/remote-julia-with-gateway-ssh/39457/4 "2020-05-14T13:28:38Z")

</div>

Great! On the top bar you will see Session Server Tools…  
Click on Tunneling  
New ssh tunnel  
check Local Port Forwarding (this is the default)

SSH server is your gateway  
SSH login in your username on that gateway  
SSH port is 22

Forwarded port - your choice. Try maybe 8888  
Remote server is your Jupyter notebook server  
Remote port - 8888  
Save

then go back to Tunnelling and start your tunnel

(I assume the Jupyter server is on port 8888)

---

<div class="post-metadata">

**Author:** ![HenriDeh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/henrideh/32/8316_2.png) [@HenriDeh](https://discourse.julialang.org/u/HenriDeh)\
**Post date:** [May 14, 2020, 1:57pm UTC](https://discourse.julialang.org/t/remote-julia-with-gateway-ssh/39457/5 "2020-05-14T13:57:28Z")

</div>

I used 24 like [here](https://docs.junolab.org/latest/man/remote/) instead of 8888 because I don’t use Jupyter.

 ![image](https://global.discourse-cdn.com/julialang/original/3X/5/3/5303a3c5b605a1ce75921e85918fcd820ef460cb.png)

I clicked on the key next to the tunnel to select the rsa file and when I clicked the play button I was asked for the password. The tunnel seems to be running.

What does this do exactly ? Does it mean I can connect using other applications (i.e. Atom) to this port now ?

---

<div class="post-metadata">

**Author:** ![johnh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/johnh/32/3615_2.png) [@johnh](https://discourse.julialang.org/u/johnh)\
**Post date:** [May 14, 2020, 2:46pm UTC](https://discourse.julialang.org/t/remote-julia-with-gateway-ssh/39457/6 "2020-05-14T14:46:49Z")

</div>

My bad. I read Jupyter when I should have seen Juno.  
If I am correct, you should be able to connect to localhost port 24 with Juno and you will be on the remote machine.

Actually on a Linux system ports \<1024 are privileged ports and you should have chosen a high number for the Local Client port. SO I would normally choose something high.  
But on Windows - I have an embarrasing gap in my knowledge.

---

<div class="post-metadata">

**Author:** ![johnh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/johnh/32/3615_2.png) [@johnh](https://discourse.julialang.org/u/johnh)\
**Post date:** [May 14, 2020, 2:52pm UTC](https://discourse.julialang.org/t/remote-julia-with-gateway-ssh/39457/7 "2020-05-14T14:52:26Z")

</div>

You have read this? [Connecting to a Julia session on a remote machine · Juno Documentation](https://docs.junolab.org/latest/man/remote/)

What MobaXterm is doing is setting up this for you, using a GUI

```julia
ssh -R <RemotePort>:localhost:<JunoPort> you@yourserver

```

Oh, and on Windows it advises to use 127.0.0.1 instead of localhost

---

<div class="post-metadata">

**Author:** ![HenriDeh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/henrideh/32/8316_2.png) [@HenriDeh](https://discourse.julialang.org/u/HenriDeh)\
**Post date:** [May 14, 2020, 2:57pm UTC](https://discourse.julialang.org/t/remote-julia-with-gateway-ssh/39457/8 "2020-05-14T14:57:39Z")

</div>

Yes I saw that documentation but the terminology is a bit obscure to me, hence my post here. I must go but I’ll try that section tomorrow and tell you what.

Thanks already
