-1

So, there exists the first SSH server, called A for simplicity, and the files and workspace I want to get to are on another SSH server, called B. Problem is, B is only accessible by SSH'ing to it from A. So if I were to do this normally, I'd ssh into A, and from there ssh into B, or just ssh -t A "ssh B" which becomes mildly inefficient, if I were to code in B using vim.

So I don't know exactly how to sshfs B onto my local machine, but I can sshfs A. Sshfs'ing B onto A isn't possible, as A doesn't have it installed. Is there a way to sshfs B?

A and B are both Ubuntu Ubuntu 18.04.3 LTS and my computer is a Macbook Pro 2015. I've tried the SSH-FS extension with VSCode. It only connects to A.

I also tried the Remote-SSH extension, and again, only gets as far as A. I even used -t for the connection command, but it doesn't seem to make any changes to the Remote-SSH config file.

I also tried ssh-fs while tunneled into A. No results there either.

Sorry for the trouble. This is a really niche problem.

unhappycat
  • 406
  • 1
  • 4
  • 16

1 Answers1

1

You must use .ssh/config to have the ability to connect to B in on command from your Macbook Pro .

a example :

Host serverb.via.servera
    HostKeyAlias            serverb
    User                    account_on_b
    ProxyCommand            ssh account_on_a@servera  -W serverb:22

before using sshfs , you must test the setting by running :

ssh  serverb.via.servera

and if you have your shell , so you can run

sshfs serverb.via.servera:/yourdir/ /tmp/localdir/

remarks:

  • serverb.via.servera is a arbritrary string , that you must use instead of the host

  • account_on_a and account_on_b must be replace by the login you use on each servers

EchoMike444
  • 1,513
  • 1
  • 9
  • 8
  • How would `serverb.via.servera` work? Something like `ssh user@domainb.com.via.user@domaina.com` ? – unhappycat Oct 18 '19 at 11:23
  • Use `ProxyJump` option, instead of `ProxyCommand` if your openssh version supports it. It is simpler to understand and works the same way. – Jakuje Oct 18 '19 at 16:02