How Can I Open Remote Files Locally from the Terminal on macOS?

0
17
Asked By CuriousKoala92 On

I'm a computational biologist at an academic lab, and I do most of my work via SSH on the university's HPC, managing large data files and coding with neovim. Previously, I was using MobaXTerm on Windows, which had a useful remote file browser feature allowing me to click and open files locally from the terminal. Now that I'm switching to macOS, I want to replicate that functionality. While I understand I can mount the remote filesystem, it's not as seamless as having it integrated with my terminal environment. Ideally, I want to navigate the remote files from the command line and quickly open the results in Excel right away for my PI, who prefers that format. I've looked into various solutions, but they all feel more cumbersome than MobaXTerm. Is there an efficient way to do this on macOS?

5 Answers

Answered By RemoteGuru77 On

Check out Remote Desktop Manager—it’s been a while since I used it, but I remember it having a decent file browser feature for SSH connections. It might help you manage your remote files more easily.

Answered By MacScripter22 On

I’d recommend using macFUSE along with sshfs. Although it might not cover every feature you're looking for, it's a robust option for syncing files between your remote server and local machine seamlessly.

Answered By FileMaster99 On

Have you thought about using a separate SFTP client like Transmit? It might take you out of the terminal for that part, but it can act as a decent file manager. You would just need to quickly switch back to your terminal for the command line stuff. You could save time between script runs and viewing results, especially if you're working in multiple directories.

Answered By TechWhizKid88 On

You might want to consider setting up a local X11 server on your Mac. This way, you can run X11 GUI applications on the server and have them display on your local desktop. Bear in mind that this won't allow you to open Excel directly, but it could be an option while you're working on other things. Also, your CLI workflow doesn't necessarily have to accommodate your PI's needs; they should have their own way of accessing the files. If you can find an SFTP client that can seamlessly shadow your $PWD, that might help you access files without too much hassle.

Answered By UnixNinja23 On

You could set up SSHFS along with your SSH config file. An example setup would look like this:

```
Host myremote
Hostname your_remote_hostname_or_ip
User your_username
PermitLocalCommand yes
LocalCommand sshfs %r@%h:/remote/path /local/mount/point &
ControlMaster auto
ControlPath ~/.ssh/cm_sockets/%r@%h:%p
ControlPersist 10m
```

This way, you can mount remote directories more seamlessly and maintain your workflow.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.