35 votes

How do I SCP a file through an intermediate server?

Since OpenSSH 7.3, you can use -J or -o ProxyJump to specify the bastion/jump host. Therefore, to SSH to node2 via node1: ssh -J you@node1 you@node2 SCP doesn't have the -J argument, but it does ...
ZiggyTheHamster's user avatar
24 votes

SSH Reverse socks tunnel

local$ ssh -R 1080 remote remote$ curl --socks5 localhost https://example.com since OpenSSH 7.6 ssh(1): add support for reverse dynamic forwarding. In this mode, ssh will act as a SOCKS4/5 proxy ...
zmx's user avatar
  • 349
20 votes

VSCode SSH with multiple hops

I believe the cleanest way to do this would be to add the following in the ~/.ssh/config Host HostA HostName hostA User userA Host HostB HostName hostB User userB ProxyJump HostA Now you ...
Cydouzo's user avatar
  • 317
17 votes

How to make an SSH tunnel publicly accessible?

You can also use a double forward if you won´t or can change /etc/ssh/sshd_config. First forward to temporary port (e.g. 10080) on loopback device on the remote machine, then use local forward there ...
panticz's user avatar
  • 311
17 votes

How can I set in the bitvise ssh client, the tunnel automatic connect if open windows or restart windows?

The Bitvise SSH Client user interface does not provide an option to start the profile automatically when Windows 10 starts up. Instead, you can create a shortcut to Bitvise with the -loginOnStartup ...
humbads's user avatar
  • 271
14 votes

SSH tunnel on Windows 10 to Linux Samba

how to proxy smb to a windows 10 client: short description with ssh n stuff for tunneling launch hdwwiz.exe network adapters -> Microsoft KM-TEST Loopback Adapter -> finish disable everything ...
GottZ's user avatar
  • 241
14 votes
Accepted

ssh config for multiple proxy jumps

When using proxy jump, all ssh connections originate at the original client (A in this case), and the intermediate nodes are just tunnel endpoints. So in your case, all config (including private key ...
Gordon Davisson's user avatar
12 votes
Accepted

ssh inline proxy jump using keys is not working

I understand that the syntax looks like this: ssh -J A B Yes, but that's not the whole story. -J is not a standalone flag – it doesn't simply let you specify two independent sets of connection ...
u1686_grawity's user avatar
12 votes

SSH parameterized config entries?

Credit to Kamil for bringing me to the idea with the Match in the first place, it looks like his answer is the working one if you do not have one of the latest openssh versions (which is probable not ...
gepa's user avatar
  • 1,071
11 votes
Accepted

SSH Tunnel via native Windows bash: Address already in use

In case anyone else finds this, there is a work around... you just need to reformat the tunnel with a specific bind address like this: ssh -L 127.0.0.1:8022:173.22.0.1:22 [email protected] From ...
dnszero's user avatar
  • 226
11 votes
Accepted

SSH parameterized config entries?

The below solution was tested with ssh from OpenSSH, version 9.3 (but it should work with reasonably non-ancient older versions as well, I guess from 7.2 where bz#2471 was fixed). For 9.4 and later ...
Kamil Maciorowski's user avatar
10 votes

SSH forwarding through PuTTY not working on Windows 10

TCP port 49900 is within the port range (49152 to 65535) that is reserved for dynamic ports. You should not open services using ports in that range. The recommended port range is from 1024 to 49151.
Robert's user avatar
  • 7,858
9 votes
Accepted

SSH: Effects of no-pty login option in authorized_keys

After some research and experimentation this combination of options seem to do the trick: command="",restrict,port-forwarding,permitopen="localhost:80" Let me go through each of them individually: ...
Tad Lispy's user avatar
  • 921
9 votes
Accepted

Does OpenSSH support multihop login?

I do not know how Ansible uses OpenSSH. But OpenSSH itself supports "multihop logins". Since OpenSSH 7.3, you can use -J (jump) switch like: ssh -J [email protected] user2@host2....
Martin Prikryl's user avatar
8 votes
Accepted

Extend or inherit existing entries in .ssh/config

You should be able to do: Host myhost-* Hostname localhost User me ServerAliveInterval 30 ProxyCommand ssh -q external-relay /usr/bin/nc -w 90 localhost 9889 followed by: Host ...
Tomek's user avatar
  • 1,218
8 votes
Accepted

SSH tunnel not working (Firefox for Mac --> remote Debian SSHD)

I feel that you are expecting firefox to connect to your Debian SSHD service directly? If that's the case, your understanding of SSH tunnel is completely wrong. You need to run ssh client on the ...
SparedWhisle's user avatar
  • 4,165
7 votes

Automatic SSH tunneling from Windows

I tried many solutions like SSH tunnel managers, but all were inconvinient for me: too many configuration screens, sometimes buggy (one time SSH tunnel manager purged all! settings I had! So I had to ...
Tony's user avatar
  • 171
7 votes
Accepted

SSH tunnel on Windows 10 to Linux Samba

You should only need to forward port 445. In putty the local port should be loopbackIP:44445(or any other unused port) and the forward destination should be localhost:445 or 127.0.0.1:445. It ...
Matt's user avatar
  • 86
7 votes

VSCode SSH with multiple hops

After reading this answer, I updated the ~/.ssh/config file as follows: Host hostB HostName hostB User userB ProxyCommand ssh userA@hostA -W %h:%p and I was able to connect.
Jacob Stern's user avatar
7 votes

SSH parameterized config entries?

While the OpenSSH "tags" feature mentioned by 'gepa' is probably the neatest option when available, it's still recent enough that your systems are likely to not have it yet, and in that case ...
u1686_grawity's user avatar
6 votes
Accepted

SSH local port forwarding to a website

This technique works, but is not very good for accessing websites since you need to forward a port for each and every domain being accessed. If you load slashdot in chrome and use the developer tools, ...
Jeff Aigner's user avatar
6 votes
Accepted

SSH key or user restricted to only making a SOCKS proxy

The OpenSSH ssh client can do two types of forwarding, through the -L and -D options. These two types of forwarding work differently in the client, but they use the same SSH protocol features and the ...
Kenster's user avatar
  • 8,019
6 votes
Accepted

Remote port forwarding through a jump server

I finally found the solution to my problem on another SlackExchange community, see this post. It consists in using the -J option ( it's a shortcut for a ProxyCommand or ProxyJump option, but ...
jmon12's user avatar
  • 191
5 votes

Automatic SSH tunneling from Windows

Two great tools : Both have those features : Could be automated at boot Opensource Manage many tunnels at the same time Could reside in the system tray Free of charge (Mobaxterm have a free version)...
intika's user avatar
  • 1,333
5 votes

SSH alternative for a long range/high latency connection

mosh (Mobile Shell) is what you are looking for, though you need it on both client and server side... https://mosh.mit.edu
Or Elimelech's user avatar
5 votes

Using WinSCP with SFTP server and two SSH tunnel hops

WinSCP has direct support for one hop. See the Tunnel page of its Advanced site settings dialog. For the other hop (the first of the two), you can use plink in "local proxy command" feature. The ...
Martin Prikryl's user avatar
5 votes

How can I resume a large scp file transfer when using port forwarding?

Use sftp instead of scp In your case: sftp -a -P 4567 me@localhost:/path/to/large/file.gz . From the sftp man page: -a Attempt to continue interrupted downloads rather than overwriting ...
AlexR's user avatar
  • 51
5 votes

Open SSH port a bad idea on a Raspberry Pi?

In terms of security, three additional methods come to my mind. A: use public key authentication To add to security, you can set up your SSH server to use public key authentication. That is, either ...
5 votes
Accepted

Relay two SSH connections together

You don't need any specialized triggers on relayhost. All you need to do is use remote port forwarding with ssh -R instead of local port forwarding with ssh -L. Now if i understand it correctly - ...
Marek Rost's user avatar
  • 2,076
4 votes
Accepted

When would you use ssh -L instead of ssh -D

The simple answer is that not all programs speak SOCKS, which is needed to use -D. The vast majority of them either support only HTTP CONNECT proxies, or have no proxy settings at all – they expect an ...

Only top scored, non community-wiki answers of a minimum length are eligible