The Transport Control Protocol (TCP) is a low-level part of the protocol stack used by the Internet. It sits directly above the IP layer and is responsible for making sure that dropped packets are resent.

learn more… | top users | synonyms

12
votes
1answer
4k views

How can I configure a reverse SSH connection to the connecting computer?

I'm going to be deploying a number of machines in the near future which will be behind routers. It won't be feasible to set up dynamic DNS on each router and port forwarding, so is there a way I can ...
18
votes
1answer
22k views

How does tcp-keepalive work in ssh?

I am trying to code a shell-script that uses a ssh-connection for doing "heartbeats". I want to terminate the client- and server-side of that connection after a certain timeout (after the connection ...
7
votes
4answers
10k views

Logging outgoing connections as they happen

Is there a way to log to file all the outgoing connections that a process creates? I am aware of netstat but that seems to be more of a snapshot of a point in time rather than something that runs and ...
5
votes
1answer
4k views

iptables port-mirroring

I need to be able to get a copy of packets received on port 8001 to port 8002. I have tried the following but I get an error that --tee is undefined. sudo iptables -t nat -A PREROUTING -p TCP -s ...
11
votes
2answers
41k views

Orphaned connections in CLOSE_WAIT state

I've got a SLES machine that accumulates TCP connections in a CLOSE_WAIT state for what appears to be forever. These descriptors eventually suck up all available memory. At the moment, I've got 3037 ...
18
votes
1answer
8k views

Why are the first 1024 ports restricted to the root user only?

This is more idle curiosity than anything else. A friend of mine asked me 'which port range is it that only root can use under Linux?' I told him 0-1024 were restricted. Then he asked my why it was so ...
3
votes
1answer
2k views

socat reliable file transfer over TCP

I am aware of disadvantages of "wait->stop" design, that usually is proposed with netcat: server$ cat test.dat | nc -q 10 -l -p 7878 client$ nc -w 10 remotehost 7878 > out.dat (It's not reliable ...
17
votes
6answers
18k views

Linux: allowing an user to listen to a port below 1024

I need to allow an user (different from root) to run a server listening on port 80. Is there any way to do this?
14
votes
4answers
953 views

TCP dies on a Linux laptop

Once in several days I have the following problem. My laptop (Debian testing) suddenly becomes unable to work with TCP connections to the internet. The following things continue working fine: UDP ...
6
votes
2answers
267 views

what's the format spec for `ss -D `?

Background of the question: I am trying to sum up the total bandwidth, but ss -i cleverly converted numbers to more readable format like Kbps/s or Mbps/s, which is not accurate. So does ss -o with ...
8
votes
3answers
4k views

Using in/out named pipes for a TCP connection

I've been fiddling with getting this to work for a while now, so I suspect some sort of fundamental misunderstanding about how pipes work is the root cause of my troubles. My goal is to initiate a ...
3
votes
2answers
2k views

SSH tunnel to router periodically hangs. TCP problem?

Something weird I've noticed since upgrading my office router to the Buffalo WZR-HP-G300NH. When I remote in using an SSH tunnel, the tunnel will "freeze" pretty often. The freeze lasts 1-2 minutes ...
2
votes
1answer
67 views

how to connect ssh 'with' specified port?

I know how to connect 'to' a certain port when ssh'ing. ssh user@remotehostip -p XXX but is there a way to establish a ssh 'with' a certain port? I mean, is there a way to specify the port which ...
2
votes
1answer
1k views

Why can't I use strace with rsh?

If I run rsh, it works, but prints some strange “Connection refused” messages at the beginning: $ rsh localhost pwd connect to address 127.0.0.1 port 544: Connection refused Trying krb4 rsh... ...