Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a regular linux box with limited banwidth which I acess through SSH.

From time to time I transfer files to/from this box with sshfs/sftp.

Please advise me on how can I set up the traffic shaping on this box so that the (interactive) ssh sessions remain responsive irrespective of the sshfs/sftp transfers.

Thank you.

Best wishes,


share|improve this question

migrated from Feb 13 '11 at 23:42

This question came from our site for professional and enthusiast programmers.

You can use WonderShaper to get pretty good QoS for ssh, and to tell SSH and SFTP apart.

Wondershaper does this based on the Type of Service bit in the IP header. SSH sets this correctly, so it's pretty easy to perform QoS based on it.

# TOS Minimum Delay (ssh, NOT scp) in 1:10:

tc filter add dev $DEV parent 1:0 protocol ip prio 10 u32 \
      match ip tos 0x10 0xff  flowid 1:10

For the theory, see the Linux Advanced Routing and Traffic Control HOWTO.

share|improve this answer

The default ssh_config should automatically set IPQoS appropriately for interactive versus non-interactive invocations.

Just make sure you're obeying those IP options in your traffic shaping configuration.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.