28 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 ...
18 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 ...
  • 289
15 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 ...
  • 281
14 votes

Route teamviewer desktop client through SSH tunnel in PuTTY?

Yes. Goto Extras->Options->General ...click on "Configure" for proxy settings. Change to manual proxy and for Proxy IP enter socks5://127.0.0.1 and the port you are using. Obviously change the 127....
  • 141
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 ...
  • 241
12 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" ...
  • 221
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 username@172.11.0.1 From ...
  • 226
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 user1@host1.example.com user2@host2....
9 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.
  • 7,424
8 votes

Is there a sshuttle equivalent for windows - ssh tunneling for windows

I believe the OP is asking for a way to tunnel all traffic not just ones that let you set proxy settings. The problem is that some programs do not let you specify proxy settings which is where ...
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 ...
  • 1,008
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 ...
  • 3,865
7 votes

SSH connection between two behind-nat computers through third public-ip computer

I have tried to better explain the accepted solution below. Let us assume "machine A" and "machine B" are both behind NAT firewall. While both have ssh access to a remote "machine R" (say a VPS). R -...
7 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: ...
  • 831
6 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 ...
  • 76
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 ...
  • 7,060
6 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 ...
  • 177
6 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 ...
  • 393k
5 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 ...
  • 151
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)...
  • 1,263
5 votes
Accepted

Probing a port for RDP

I figured out an easy way to do it. When my script executes the netstat command on the router to verify that the RDP tunnel is open, I can also send an RDP connection request over the tunnel using ...
  • 202
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
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 - ...
  • 1,981
5 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, ...
4 votes
Accepted

Why isn't openssl s_client passing my private key to proxytunnel?

You are confusing the clients of two completely different protocols. The openssl s_client tool is purely a TLS (SSL) client; it is capable of peeling away the TLS layer that HAproxy or stunnel might ...
  • 393k
4 votes

Using reverse SSH to connect two clients over one server

I don't think there is an easy way to do this on a mass scale. And you don't really mention the scope of these ssh connections. Terminal only? Might make things a bit easier. Run ssh -NR 2210:...
  • 431
4 votes

How to ssh a computer which is behind firewall

If you can set up an outgoing ssh connection, then you can probably set up a reverse tunnel to get back in (I'm not aware of there being a way for IT to forbid this, but you never know). work:~# ssh -...
  • 1,187
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 ...
4 votes

How to ping through SOCKS5 proxy?

ICMP protocol won't work over SOCKS, but you can employ nmap to do TCP ping. Check this l4ping to see how to do that.
  • 6,129

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