Please suggest a workflow for working on a remote machine.
My organization has a very powerful machine that I use to run my ML models. It runs on some version of Ubuntu. Due to this ongoing pandemic, I have to work from home. This machine is not public facing and therefore, I VPN into my organization network using OpenFortiVPN. And then I SSH into that machine.
The problem is that my internet is not very good and/because it a mobile network that I tether on my machine (and that's why I get a dynamic IP evertime I am connected to the network). However, that machine at my organization is connected to very good network. The datasets that I work with are hundreds of GBs. I cannot download the dataset and work on my machine. The dataset and computing power reside on the remote machine, not on my machine. Suggest a workflow for this setup. The problems I face are,
Please don't suggest me Jupyter (or alike) as I like to work in a terminal with my own editor (that has been vimrc-ed to hell) and also, my python scripts are dependencies everywhere that Jupyter doesn't handle well. I need my bare bones python. Admittedly, I'm new to SSH, and VPNs and networking so, if there is something obvious that I'm missing in my setup, please tell me. |
without GUI the best you can do is tmux or screen or something similar.
ssh can be used with -X (or -Y) if you wish to use GUI. But probably not the best solution for you. You can try VNC to have a local display somewhere and you will only connect to that display (or actually you can try any other remote desktop solution). We cannot help on the lagging, that should be solved by (or inside) your company and ISP. |
Quote:
You can also reconnect SSH and tmux automatically if you are authenticating to the remote machine with keys or certificates. Here is an example of reconnecting automatically using a key and from there reconnecting to an existing tmux session named 'models' or create it if it does not already exist. Code:
ssh-add ~/.ssh/somekey; Code:
Host model2 Code:
while ! ssh model2; If you need to run a graphical program on the remote host yet have it displayed locally, throw in -X to the above formula. However, there can be a bit of lag when working interactively that way. |
Oh yes, TurboCapitalist already explained, here is a possible solution to the timeout (last point): https://patrickmn.com/aside/how-to-k...-ssh-sessions/
|
ssh does have an idle time out and will automatically disconnect but looks like it just hangs. You can adjust some settings in the ssh_config file as posted
As posted tmux or screen are your only options with out a GUI. Any remote desktop would likely increase bandwidth needs and increase lagging. Your only solution is to get a better personal network connection if possible. |
(Oops. I am slow in typing. )
Quote:
Quote:
You could then connect to the inner machine via the jump host using the ProxyJump option. Code:
ssh -J jump.example.com model.example.com As for the connection dropping, that too might be the VPN. If you have the SSH client send both a TCP and SSH heartbeat maybe that will help as mentioned. From the tail end of ~/.ssh/config Code:
Host *.example.com |
Quote:
|
Changing the prefix key is easy. Here it is changed to ctrl-backslash, but it could be set to anything else just as well:
Code:
tmux set -g prefix C-\\ Code:
set -g mouse on Then you can highligh the text, press Enter, and it will be in the local machine's clipboard. Remember that Enter and Return are not the same. |
Thank you, Turbocapitalist for taking time to help me and showing around. Guess its time to read man pages.
|
All times are GMT -5. The time now is 11:37 AM. |