I have set a VPN tunnel from my laptop at home to my desktop at the lab. Only from the lab I can access the workstation.

When I'm in the lab I use Spyder to open my python files from the workstation. To do this I use 'Connect to server' in Ubuntu. Then I can easily surf the folders and files from the opened window; and right-click, open with, spyder. I work comfortable with the interested files and, when I'm ready, execute them in the workstation with ssh.

From home I can of course use the ssh to remote the workstation. I use vim and for small jobs I am happy. But for more ambituous tasks I want spyder.

The question is: How can I open(edit/save) files in the workstation from Spyder in my home? For example using 'connect to server' would be nice but every solution is also fine.


You could use a network file system of some sort. sshfs is probably the easiest to get working for this purpose - certainly easier than setting up a vpn to tunnel SMB or NFS securely.

Description from the debian package of sshfs:

Description-en: filesystem client based on SSH File Transfer Protocol sshfs is a filesystem client based on the SSH File Transfer Protocol. Since most SSH servers already support this protocol it is very easy to set up: i.e. on the server side there's nothing to do. On the client side mounting the filesystem is as easy as logging into the server with ssh.

Another useful alternative worth considering is to set up a git server somewhere where both your home desktop and the lab workstation have access to, edit wherever you happen to be with whatever editor you like, and use git push and git pull to keep them in sync. Bonus is that you get to keep a revision history of the programs you're writing.

There are at least as many pages and blog posts about setting up a server for git as there are tools to do it. Here's a few I found with google:

https://git-scm.com/book/en/v2/Git-on-the-Server-Setting-Up-the-Server https://www.linux.com/LEARN/HOW-RUN-YOUR-OWN-GIT-SERVER

PS: I use gitlab in docker as my home git server. It's overkill for my needs, but i find the fact that it can run a docker repository as well as git to be quite useful.

  • (i) There are three computers with their respective names: (H)ome, (L)ab and (W)orkstation. I can access W only from L; with ssh. I can access L from H; with openvpn and ssh. With sshfs I could get TheFolder (that I need) from W in L. But what I need is TheFolder in H. (ii) I can't work with git as you suggested because I don't know beforehand if my code will work. I program and then I can check if it's ok by executing only in W. So the practice is code-execute-waitResult. Do you know any other trick with sshfs? – prometeu Aug 6 '17 at 17:16
  • ssh port forwarding can be used to connect from H to W via L. Mounting file systems over two SSH hops seems like a good description of the procedure. BTW there's no rule that says only perfectly working, tested code can be checked in to git, especially if it's only for your own private use. – cas Aug 7 '17 at 1:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.