How-To Determine Programs Using Open Port?
How can I determine which program is using an open port?
This question comes up all the time on forums and at LUG meetings. As usual, with Linux there are 100 different, correct answers. Here are two more of different capability.
lsof
sudo lsof -l -P|grep LISTEN
lsof – list open files. Requires admin-level access. Running it without sudo will show this.
grep – look for specific things in the output.
On most desktop systems, I’d expect to see only ntpd, sshd and cupsd in the list. Might see smbd and rpc.statd (NFS) too if those were setup.
netstat
Another option:
netstat --all --program|egrep -v unix|more
Shows much of the same information, just in a different format, but it also shows live connections outbound. Since this shows outbound connections, email, browser, IM and any socket connection within the same machine will show up too. Might need to use sudo on the netstat to see some programs, but at least most of the output does not need root.
So, how else can we find which programs are using open ports?
How-To Migrate Debian/Ubuntu Systems and Data Overview 2
From time to time, we all need to migrate our systems from 1 machine to another. With Linux, often it is possible to swap the old HDD into the newer machine to get that accomplished. Sometimes that is not an option and we need to migrate the data, settings and installed programs some other way.
A few options to accomplish this are below. This is an APT package manager solution. Other Linux package managers should work in a similar way, just replace the dpkg commands with whatever the package manager needs for your specific system.
Encryption Means Great Backups Needed 2
For a few years now, Linux installations have offered to encrypt our HOME directories as part of the installation. On portable devices, this is a great idea – after all, the risk of loss or stolen equipment on a portable device is real.
Portable Devices NEED Encryption
For a while, I ran virtual machines on a laptop inside a Truecrypt partition. Encryption is good for some things, but doing it badly does still happen. I still use Truecrypt on my laptops.
Android Music Player? 6
I must be stupid. At least that is how I felt trying to play local music on my Nexus4.
I listen to books-on-tape all the time … walking, in the car, road trips … I’m listening to a book almost always. At home, my stereos have links to a CD collection that took me 6 months to rip doing 2-10 CDs a day. The CDs are safely stored in a box somewhere, but the ripped files are on the network and I copy over Best of to portable devices as desired.
Best Linux Apps ... 1
Found a reasonable list of the Best Linux Apps . While I do not agree with all of them, many are my favorites too.
In the editor section, I would add geany. It is like Notepad+ on Windows, but cross-platform. Syntax highlighting for many languages, spell check plugin, and many other IDE features without the bloat of a typical IDE. Functions, classes, method completion … are covered.
Take a look – perhaps one of the options will fill a need for you too?
When installing, be careful about apps with too many dependencies. Is it really worth loading almost all of KDE to have 1 app?
Setup KVM Virtualization 4
Update 4/2015
For Ubuntu 14.04 and later, FreeNX use has stopped. We switched over to x2go and have been using it daily from local and intercontinental remote locations to access 14.04 remote desktops. It has been performing better than FreeNX did with only a minor issue – only 1 remote desktop can be displayed concurrently on a client machine. That isn’t a big issue for us, but it could be for others.
In short s/freenx/x2go-server/g and s/nxclient/x2go-client/g for the remainder of this article. Hope that is clear.
Original Article
Below is a sample way to setup and use KVM with virt-manager as the VM management client for your consideration. It is not a How-To, rather it shows how the peices fit between local and remote and the hostOS vs clientOSes running inside virtual machines. I hope this diagram helps.
Ubuntu 13.10 under KVM with Spice 5
Installed Ubuntu 13.10 x86 under an ubuntu 12.04 KVM server.
Installation
VM Settings:
- 1G of RAM
- 500MB swap
- 10G of ext4 for /
- Cirrus video – 9MB
Install started at : 08:43:54 EDT 2013
Install ended at : 08:58:07 EDT 2013
Reboot.
forgot to remove the installation ISO file – remove and reboot again. ;)
Login.
About 15 minutes to install a full desktop OS? What is not to like?
13.10 Ubuntu Mandatory Update
When people choose to install Ubuntu, they usually grab the latest release because we have been conditioned to think that newer = better. Sometimes that is true, but not always.
All the people who installed Ubuntu 13.04 should be updating to 13.10 soon. There isn’t really any choice.
Rdiff-backup Real Use 5
I like rdiff-backup. It isn’t perfect, but for my needs, it fits. I’ve written about it, mostly in abstract ways, over the years. Seemed like time to show a non-trivial example. Below is the command used to backup a major storage server here.
$10 Cell Plan Continues 4
For the last … 7+ yrs, I’ve been paying about $10/yr for a cell phone plan.
Just added my annual $10 to the pre-paid account a few minutes ago to keep all the minutes alive for another 365 days.
Also, if it isn’t clear, I’ve had a smartphone for the last 2 yrs and only a voice plan. No data. Data works great from wifi. GPS also works if you cache the maps or if you use an offline map program like NAVFree. No Data Required Apps
I’ve described this $10/yr Cell Phone Plan before for anyone new to my blog.
- It might not work for many people, but it does work for many more than who are using it.
- If you are into minimizing, it could be for you.
- If you have a home phone AND a work phone, it could be for you.
- If you avoid talking when driving, it could be for you.
- If you don’t chat on your cell phone, it could be for you. Mainly emergency use and a few out-plans-have-changed calls every week.
- If you don’t need a data plan to earn a living, it could be for you.
There have been times when not having a data plan has been bad, but that happens only when I’m overseas and unlikely to have a data plan for the limited time there anyway.
Between dumping CableTV and not having a monthly cell bill, I’m easily saving $2000/yr.
Our electrical bill is in the lowest 1% for similar homes, so saving much there probably isn’t possible. Ceiling fans.
Our water and gas bills are routinely at the monthly minimal charge just to have service, so saving much there probably isn’t possible.
We could cut back on expensive foods and alcohol. Perhaps not.
Any other ideas for saving money from monthly expenses?
BTW, the pre-paid plan balance is $79+ after adding the $10 more today.