1

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?

3 Answers 3

2

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

4
  • 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, 2012 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, 2012 at 12:37
  • Do you use python @DrewvonBratt
    – Amith KK
    Feb 22, 2012 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, 2012 at 13:11
0

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.

0

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:

#!/bin/sh
# 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 127.0.0.1 -j ACCEPT
sudo iptables -A OUTPUT -p tcp -d 192.168.0.1/24 -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 "192.68.0.1/24" 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).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .