Forums

SHS Remote File Editing Using GNU Emacs' Tramp

Dear all,

Has anybody been able to get tramp working to edit source files on PythonAnywhere? I am using version 26.2 on Windows 10. To launch Tramp, I issue the following command

M-x  /ssh:user@host:/path/to/file

I am using my PythonAnywhere user name in place of "user" above and ssh.PythonAnywhere.com in place of "host" above. The minute I click on : after "host", Emacs attempts to connect and hangs indefinitely.

Any ideas would be greatly appreciated.

That's not something we've got experience with here at PythonAnywhere, but I can't see any obvious mistakes in the config. What happens if you just try doing a normal SSH into our site from your command line?

Since posting this, I found the solution on Windows 10, but it should work identically on any OS.

Prerequisite: Install Putty. Emacs will use Putty seamlessly and with no other configuration.

The key is to type

C-x C-f /plink:<user name>@ssh.PythonAnywhere.com:<path to the file>

In my case the stuff after /plink is

/plink:pabloperez@ssh.PythonAnywhere.com:/home/pabloperez

In fact, the second you type :/ after PythonAnywhere, Emacs will autocomplete the available files. of course, you will prompted to enter you PythonAnywhere password before listing the files.

Incidentally, you can also us Dired the same way. It will let you navigate and manage files from Emacs as if your PythonAnywhere files were hosted on your own computer.

Thanks! Looks like it's valuable information for other potential emacs/PythonAnywhere users.