Answer the question
In order to leave comments, you need to log in
How to access files on server via 2 ssh?
Good afternoon!
Suppose there is an internal company network (intranet).
You can connect there via ssh, through a public server commonserver.company.ru
Inside it there are many sites with addresses site1.company , site2.company , and so on.
I want to connect to the site site1.company from home , and also edit files in my editor that are on this site.
To access this internal site, I enter the command in the terminal (the port can be any) ssh -D 3355 [email protected]общийсервер.компания.ru
and then in Firefox I put "Manual proxy settings", where in the SOCKS line I have 127.0.0.1 3355
After that, I can open sites through firefox site1 .companies ,site2.company , and so on.
But I also want to access the files on the site1.company server so that I can edit them in my editor.
I can access files, for example, after this sequence:
ssh [email protected]общийсервер.компания.ru
ssh [email protected]сайт1.компани
Answer the question
In order to leave comments, you need to log in
Do you happen to have a vpn there? Because so far the only option that comes to mind is with an SSH tunnel through which the second SSH is used to connect sshfs. This is fraught on channels with jitter and / or packet loss, because TCP inside TCP and congression control in such a situation will work at both levels, which can lead to all sorts of unpleasant effects such as a long session hang.
SSH option:
ssh -L 2222:сайт1.компани:22 [email protected]общийсервер.компания.ru
sshfs -p 2222 localhost:/путь_к_каталогу_на_сайт1.компани/ /локальный_каталог
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question