27
votes
Accepted
ssh -R make target host accept connection on all interfaces
By default, it will listen on localhost (loopback interface) only. You need to specify the bind_address as 0.0.0.0 in your command:
ssh -R 0.0.0.0:2222:localhost:22 TARGET -N
You need also to ...
25
votes
How to add local forward setting to my ssh config file?
I think, you have differently defined command and config. In command, you are using localhost and in config, IP address (12.34.56.78). This should works for you:
Host myhost
User myuser
...
24
votes
Accepted
SSH access gateway for many servers
That's too complicated (checking if a key has access to a specific prod server). Use the gateway server as jump host that accepts every valid key (but can easily remove access for a specific key ...
22
votes
Accepted
How can I use port tunneling to connect to a private database instance through a network bastion?
When you create an SSH tunnel, it does not expose the opened port to the outside world. The opened port, is only available as localhost. So effectively what you've done is to create a tunnel from your ...
18
votes
Forward SSH through SSH tunnel
As of OpenSSH 7.3 (late 2016) the easiest way is the ProxyJump setting. In your ~/.ssh/config:
Host B
ProxyJump A
Or on the command line, -J B.
16
votes
What is the difference between Local/Remote/Dynamic SSH tunneling?
I have drawn some sketches
The machine, where the ssh tunnel command is typed (or in your case: Putty with tunneling is started) is called »your host«.
static (options -L local and -R remote)
local: ...
15
votes
Accepted
SSH: What's the difference between -L and -R?
It's right there, in the man page:
-L
Specifies that connections to the given TCP port or Unix socket on the local (client) host are to be forwarded to the given host and port, or Unix socket, on the ...
15
votes
Accepted
ssh -R binds to 127.0.0.1 only on remote
While the local optional bind address is at the control of SSH's client side (specified with -L/LocalForward or altered with -g/GatewayPorts in the client's configuration), the remote optional bind ...
12
votes
Accepted
SSH Local Port forwarding working from localhost only
Are you aware that you type 4122 in the example?
You should try
-L *:4420:172.88.3.31:22
The star implies that you listen on all addresses, and not localhost, which you cannot connect to from ...
11
votes
how to solve the "open failed: administratively prohibited: open failed" when using a SSH tunnel proxy
There is a broader discussion of this error with SSH tunnels on Unix StackExchange. In a nutshell, this is a non-specific error; there are numerous possibilities that should be explored.
11
votes
Accepted
Add temporary entry to hosts, when tunnelling SSH
I have a solution for you, wrap your ssh command into a bash script:
#!/bin/bash
function control_c {
echo -en "\n## Caught SIGINT; Clean up /etc/hosts and Exit \n"
sed -i '' "/internal-wiki/...
11
votes
SSH access gateway for many servers
Engineers should not be running ansible directly from their laptop, unless this is a dev/test environment.
Instead, have a central server that pulls the runbooks from git. This allows for additional ...
10
votes
Accepted
How to SSH tunnel with keys
Despite the authentication method used, SSH tunneling works the same way. The problem here is not about using public key authentication but understanding the basics of How to Use SSH Tunneling.
Your -...
10
votes
Accepted
How to add local forward setting to my ssh config file?
The syntax of the ssh_config file was correct - so the error had to be somewhere else. The command line which worked was:
ssh 12.34.56.78 -L 8888:localhost:8000
but in the LocalForward directive, you ...
9
votes
Accepted
Working example of multiple permitopen options in authorized_keys
I've gotten it to work. The first example above works.
permitopen="host-1:3389",permitopen="host-2:3389" ssh-rsa AAAAC...
In my case it was not working because the host name is case-sensitive.
I ...
9
votes
Accepted
RDP equivalent to SSH port forwarding?
No, it is not possible with RDP.
You can install an SSH server on windows and continue to use SSH.
Alternatively, you can use netsh to do TCP forwarding as described in this answer on SO:
netsh ...
8
votes
with SSH only: reverse tunnel web access via ssh SOCKS proxy
Newer versions of SSH allow to use the very simple option of ssh -R <[bind_address:]port>. Using only the port on the host and maybe the bind address, but not specifying the client side port ...
8
votes
Accepted
Connection to postgresql hangs over SSH tunnel on OSX
I believe you have postgresql configured to listen only on loopbavk (localhost). You should use the forwarding like this:
ssh -L 5433:localhost:5432 user@serverip
Otherwise it will try to connect to ...
8
votes
access an http server as localhost from an external pc over ssh
The right syntax for create an SSH tunnel is this one:
ssh -L local_port:remote_address:remote_port [email protected]
So according to your output the command should be something similar to this:
...
7
votes
how to tunnel Windows Remote Desktop through ssh using a linux box?
One can use internal ssh tunneling from Remmina remote desktop client too.
If you can ssh to some linux server using ssh keys and that server have open 3389 (RDP) port for packets coming from your ...
7
votes
Accepted
Allow SSH Reverse Tunneling (-R), but not Local Forwarding (-L)?
sshd_config man page has it all:
AllowTcpForwarding
Specifies whether TCP forwarding is permitted. The available
options are yes (the default) or all to allow TCP forwarding, no
...
7
votes
Accepted
Is it possible to have multiple users SSH tunnel to a same local port?
Definitely. You can easily try this with your own user. Just open up two terminals and start two SSH sessions to proxy that same server port.
Session #1:
ssh -L 8080:127.0.0.1:80 ssh-user@server....
7
votes
How to ssh-copy-id through a jump-host? Something similar to the -J option with ssh command
Have you tried defining the jump connection in ~/.ssh/config and then attempting the ssh-copy-id?
I seem to recall doing something like that a few years ago to work around not being able to use the ...
6
votes
SSH Reverse Port Forward Bind to address
In order to make it bind to all interfaces, use:
ssh -N -R 0.0.0.0:2695:localhost:22 [email protected]
Don't forget to edit /etc/ssh/sshd_config and go to GatewayPorts and enable it and set it to ...
6
votes
Is there any way to log entered password from ssh?
You can visualize the failed user names after you turn up the verbosity of the log in sshd_config¹, but there is no way to see the failed passwords as this could be a potential security issue and ...
6
votes
Accepted
SSH jumping with aliases and "-F"
According to this SuperUser entry, from version 7.3p1, there is an Include directive, so you can create a config file which includes your "regular" config, but has all the ProxyCommand entries. This ...
6
votes
SSH jumping with aliases and "-F"
For proxy hosts you don't need ProxyCommand anymore. There is a new option ProxyJump, which does the same without the need of another ssh with configuration. It will internally issue the same command, ...
6
votes
Accepted
Speed up mongodump+mongorestore
Don't know why I didn't think of it:
ssh *** ". /etc/profile; mongodump --host=127.0.0.1:27017 --db=**** --archive --gzip" | mongorestore --host=127.0.0.1:27017 --drop --archive --gzip
Was 1603.96 ...
6
votes
Which command is used to establish ssh tunnel in windows?
I sense confusion and a possible misunderstanding.
When you establish a SSH tunnel with:
ssh user@server -L 5900:localhost:5900
...the following things happen:
a SSH connection is established and ...
6
votes
ssh port forwarding with firewall-cmd
You could try firewall-cmd --add-forward-port:
firewall-cmd --permanent --add-forward-port=port=222:proto=tcp:toaddr=172.x.x.x:toport=22
firewall-cmd --reload
General syntax (https://firewalld.org/...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
ssh-tunnel × 854ssh × 553
linux × 117
port-forwarding × 103
proxy × 56
mysql × 46
vpn × 46
tunneling × 44
ubuntu × 43
networking × 38
ssh-keys × 32
putty × 32
socks × 30
iptables × 28
linux-networking × 24
amazon-web-services × 22
amazon-ec2 × 21
reverse-proxy × 21
windows × 19
mac-osx × 18
security × 17
remote-access × 16
firewall × 15
docker × 13
ssh-agent × 12