Explanation of ssh command with option -D [closed] - linux

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 7 years ago.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Improve this question
I am studying ssh and I haven't understood the following command with option D
ssh -D 9999 username#remotehost.net
can someone explain what this command does exactly with an example and when it is useful?

This will forward all packets to remotehost.net from localhost:9999 (in your example). In a nutshell this is socks proxy.
From ssh man page:
Specifies a local “dynamic” application-level port forwarding. This works by allocating a socket to listen to port on
the local
side, optionally bound to the specified bind_address. Whenever a connection is made to this port, the connection is
forwarded over
the secure channel, and the application protocol is then used to determine where to connect to from the remote machine. Currently
the SOCKS4 and SOCKS5 protocols are supported, and ssh will act as a SOCKS server. Only root can forward privileged ports.
Dynamic port forwardings can also be specified in the configuration file.

Related

Run ssh forwarding command before nagios command [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 6 years ago.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Improve this question
I have a number of machines which I would like to check using my Nagios box. They sit behind a machine which is reachable from my Nagios box; all are running Linux. These machines have no routing to outside networks. If I need to reach the machines manually I either ssh to the intermediate box and then ssh to the other machines, or I'll use ssh to forward a port.
I usually use SNMP for most of my checks. So my thought is that prior to my Nagios box running a check I could have it run a command to forward the needed port, then get rid of the forward when done. Can anyone guide me on the best way to do this?
Thanks!
You probably want to look into Nagios passive checks. As described in the documentation:
Passive checks are useful for monitoring services that are:
Asynchronous in nature and cannot be monitored effectively by polling
their status on a regularly scheduled basis
Located behind a firewall and cannot be checked actively from the monitoring host
Your use case is pretty clearly the second one.

How can I SSH remotely into my linux VirtualBox? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 6 years ago.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Improve this question
I am trying to remotely access a virtual box remotely. Because this is a virtualbox hosted on a windows machine, it does not have it's own IP address to use for SSH login. I have tried changing the network settings to Bridge Adapter to get an IP, but nothing has worked. Are there some steps I am missing, or what else can I do to SSH into the box? Thanks.
If you were using the NAT mode before and you have no reason to change it other then the SSH, you can do it in that mode. Just expand the advanced settings in the network configuration and create a port forwarding rule for the port 22. Then you will be able to SSH to the VM by using the host's ip address.

Apache server not going online on ubuntu [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
I have done all steps to make my apache2 server to work online but failed to do . My isp has not blocked port 80 and i have also forwarded my routers port 80. Please help me .
Thanks in advance.
If your website is accessible in your LAN, the most probable issue is coming from your nat translation rule.
Also verify your local firewall on your webserver with :
sudo iptables -L

How do I determine the outgoing port being used by SSH after connecting? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 9 years ago.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Improve this question
I have connected to a remote server using ssh:
ssh -i <keypair> <user#server>
How do I determine the outgoing port that my ssh client is using to connect to the remote server ?
I want to know so that I can setup my VNC Client to use that port...
NOTE: I am not talking about the port on the remote server!
Look at the variable $SSH_CLIENT - the second number is the client port.
Should you want to know it from the client side, you can run this command
lsof -p pid | grep TCP
with pid being the process ID of the ssh command

Where Linux kernel(3.4.34) open port on nat device? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I use an Linux Server for nat device.
Currently it looks like [PC1,2,3]--[Linux]--[Internet]
There is no issue at all , but I'm curious about , when I open a service (ex: FTP WWW ) on my PC1 , did my [Linux] also opened a port service on it ?
I did trace code for the
CONFIG_NF_CONNTRACK_FTP
CONFIG_NF_NAT_FTP
but I cant find related code about port open.
Thanks for your read.
There are various techniques used the make a router/firewall automatically forward ports to its clients. For example there are some protocols like: IGD, NAT-PMP et similia.
But those protocol need to be implemented both on router and on client. So automatic port-mapping won't work out of the box in many cases.
The lines in kernel config you are referring to CONFIG_NF_CONNTRACK_FTP CONFIG_NF_NAT_FTP are used for another reason: due to the fact that FTP protocol use two different tcp streams for comunication (one of which does not have to be "listened" by the server) your firewall needs extra "effort" to track the connection and act accordingly.

Resources