I have installed Ubuntu Linux 11.10.

My bandwidth is being used up.

Using nethogs eth0 shows that /usr/bin/python is sending and receiving all the time.

Using netstat -tup showed that the address 48293.kwaimuk.canonical:https is using up my bandwidth.

How can I stop this?


This is ubuntu-one connecting to canonical's amazon server. kwaimuk.canonical.com and grape.canonical.com

If you dont use Ubuntu One, you can uninstall with the following command

sudo apt-get remove ubuntuone-*

Source: http://ubuntuforums.org/archive/index.php/t-1745621.html

| improve this answer | |
  • I have uninstalled ubuntuone as suggested but nethogs still shows 'usr/bin/python' as using between 10 and 20 kb.sec. and I need to stop it. – Lofty Feb 22 '12 at 12:22
  • 'iftop' now shows that 'grape.canonical.com' is using up my bandwidth at about 90kb/sec. How can I stop it please? – Lofty Feb 22 '12 at 12:37
  • Do you use python @DrewvonBratt – Amith KK Feb 22 '12 at 12:41
  • I do not use python but I understand that most of Ubuntu Linux works on python and one cannot delete it without making Ubuntu Linus unusable – Lofty Feb 22 '12 at 13:11

I actually don't know the answer to this, but this is how I would find out:

netstat has a -p flag that will show the process/pid that has a network connection open. So, your netstat -tup command can be enhanced to:

sudo netstat -tup | grep 48293.kwaimuk.canonical

(You need to be root for -p to work). The final field on the line should be a PID. If the process name just says python, get the full script name via:

ps auxw | grep PID

Now hopefully you have the location of a script/program that's using this connection. Probably something.py.

Find which package it's in via dpkg:

dpkg -S /usr/local/bin/something.py

And now you can apt-get remove the offending package. Caution here as ever, be careful what dependencies it also tries to remove.

| improve this answer | |

The problem is that python could be any number of applications, or even a background script. For example, if you use Screenlets, I believe the widgets are python processes. You can't remove python as it would disable a lot of important apps and scripts. If you want to stop leaking bandwidth, you can try what I've outlined in this Google+ post: https://plus.google.com/118226948467140990198/posts/YZhZJCZmGgm

The TL;DR version: block all TCP/IP traffic except those run by a new group you create. Then open a shell with access to that group and only apps you launch from that shell will have internet access. First create the group:

sudo groupadd internet

Now save this into a script and run it when you want to control bandwidth:

# Firewall apps - only allow apps run from "internet" group to run

# clear previous rules
sudo iptables -F

# accept packets for internet group
sudo iptables -A OUTPUT -p tcp -m owner --gid-owner internet -j ACCEPT

# also allow local connections
sudo iptables -A OUTPUT -p tcp -d -j ACCEPT
sudo iptables -A OUTPUT -p tcp -d -j ACCEPT

# reject packets for other traffic
sudo iptables -A OUTPUT -p tcp -j REJECT

# open a shell with internet access
sudo -g internet -s

You might have to change the "" bit to suit your local network. Now you will get a shell from which any apps you start (like firefox) will have internet access. The apps will still run under your username. All other apps will be blocked (unless they already have a persistent connection, in which case you will need to kill those processes).

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.