How to fix ssh timeout problems

If you use ssh a lot, you may have noticed that your ssh session times out and you’re logged out every once in a while. Annoying isn’t it?

Read from remote host ocaoimh.ie: Connection reset by peer
Connection to ocaoimh.ie closed.

There’s a quick fix for that. Actually, there are 2 ways to fix it. You only need to do one of them so choose whichever one is easiest for you. You’ll need root access, so for most people it’s probably safer to do the client fix rather than the server fix.

  • On the server, login as root and edit /etc/ssh/sshd_config and add the line:

    ClientAliveInterval 60

    According to man sshd_config, this line,

    Sets a timeout interval in seconds after which if no data has been received from the client, sshd(8) will send a message through the encrypted channel to request a response from the client. The default is 0, indicating that these messages will not be sent to the client. This option applies to protocol version 2 only.

    Don’t forget to restart sshd on the server after you save the file.

  • The other way, and easier and safer way is for your desktop machine to send those keep alive messages. As root on your desktop (or client) machine, edit /etc/ssh/ssh_config and add the line:

    ServerAliveInterval 60

    That will send send a message to the server every 60 seconds, keeping the connection open. I prefer this way because I login to several machines every day, and I don’t have root access to all of them.

I knew I had blogged about ssh timeout problems before, but I hadn’t mentioned the client fix so it’s worth a revisit!

Fixing Ubuntu 8.10

I suppose you could say I’m a long time Debian/Ubuntu Linux user, but the recent upgrade to 8.10 completely messed up my desktop machine.

  • Sound was broken in Flash. That’s happened before and doing an aptitude install flashplugin-nonfree-extrasound fixed that, but from time to time sound would break and I’d have to killall -9 pulseaudio;pulseaudio -D to get it working again.
  • My shiny new Xbox360 controller refused to work correctly in Ubuntu 8.10. Despite assurances on various Ubuntu sites that a fully updated system should now work, it didn’t. Moving the analogue stick moved the mouse pointer.
  • Editing a spreadsheet in Open Office proved impossible as whatever key or action I last took would repeat if I used the cursor keys. Hit “a” and “a” would appear in every cell when the cursor was moved. I used the mouse and TAB a lot while working on my last VAT return.
  • I wrote a DVD+RW just fine on Monday, but 3 days later when I tried to erase it, Gnomebaker complained it didn’t have permission to access /dev/sr0 (I think). I tried to mount another CD and Ubuntu complained it couldn’t read ISO9660 CDs.

I tried recreating my user account in case that helped. It didn’t. The only way to fix my broken Ubuntu 8.10 was to reinstall from scratch. After backing everything up onto one of my external drives the install couldn’t have been easier.

So, now? Any problems? ‘Fraid so.

  • I had to install flashplugin-nonfree-extrasound to get sound working in Firefox and Flash. Yay, Youtube is sounding sweet again! No lockups yet.
  • My joypad still didn’t work, despite the fact I had upgraded everything. Thankfully this bug report came to the rescue. If your Xbox360 controller refuses to work in Ubuntu, try this:

    $ xinput list
    See which device number the Xbox controller has…
    $ xinput set-int-prop THATDEVICENUMBER ‘Device Enabled’ 32 0

    I’ll probably have to add that to the Gnome Session so it’s permanent.

  • OO.org works fine thankfully. That was a showstopper bug. I even considered using Mac OS X for a moment.

Backuppc is reinstalled and configured. It now has nice RRD graphs! I’m also blown away by the folder sharing in Nautilus. This might have been available in 8.04 but I never noticed. Sharing folders via SMB has never been so easy!

I haven’t reinstalled everything I need yet, but I’m happy that my desktop is working again.

Google Chrome on Linux and Mac

Google Chrome, the open source browser that recently made headlines, was unfortunately only released for Windows. Linux and <a href="Mac users were left out in the cold.

It was possibly to get the browser working with Wine, but it wasn’t very stable by all accounts. Thanks to CodeWeavers, they have ported the Chromium browser to Linux and Mac OS X and packaged it ready for download on both systems!

First impressions of the Linux version? For some reason my whole screen goes black while a page is loading or when a new tab is opened. I see this in Vice (The C64 emulator) and any movie player other than mplayer so it’s an issue with my setup, not the browser. The fonts in the url bar suck as well, but I’m sure they can be fixed too. My curiousity is sated. CoveWeavers did a great job, but I’m going back to Firefox. (Via Tom)

So today I am pleased to announce that we have shipped freely available versions of Chromium for both the Mac and Linux. Not only does this give Mac and Linux users a chance to see what all the hype is about, it also lets the world see just how far Wine has come and how powerful it truly can be. In just 11 days, we were able to bring a modern Windows application across to Mac and Linux.

How to upgrade Ubuntu

upgrading ubuntu

I hit the Upgrade button and I presume it’s doing it’s thing. The Ubuntu 8.04 ‘Hardy Heron’ Release Notes have just popped up so it’s time to click the “Upgrade” button again. Tom has some great tips for post install configuration.

I’ll be happy if SDLMame, mplayer, UAE and Vice continue to work as normal after the upgrade. Finger’s crossed. It’s getting easier and easier to upgrade Linux distros these days!

Update! Ubuntu Hardy is now installed and it appears to be working fine. There was a problem with SDLMame unfortunately. This dialog appeared at the end of the upgrade:

ubuntu upgrade problem

I didn’t think that would be a problem to fix but then the same dialog appeared saying the “update-manager” had failed to upgrade! Oh no! Anyway, I clicked Close, thinking it was related to the SDLMame problem and then this shocker appeared:

could not upgrade!

Ah crap! It took over a day of downloading packages to get this far. Sheesh. I closed that dialog and then, nothing. The update manager closed too and I was left looking at a blank desktop. Thinking I had nothing to lose, I rebooted and to my joy up popped Ubuntu Hardy!

I reinstalled SDLMame which fixed the problems with that. Everything else works ok and I’m just wondering if I’m missing anything because the upgrade aborted? Who knows. It works. I’m happy.

HOWTO: Ubuntu desktop visual effects on Dell D630

The Dell Latitude D630 comes with a number of different video cards but if you use the Intel chipset you may be frustrated when trying to activate the visual effects eye candy of Compiz:

Ubuntu Visual Effects

Checking either of the lower two options brings up this alert saying, “Desktop effects could not be enabled”.

Ubuntu Visual Effects

I didn’t bother trying to fix it for ages and put it down to using Ubuntu on exotic hardware. Fortunately it’s simple to get working. I just needed to install the xGL server:

# aptitude install xserver-xgl
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initializing package states... Done
Building tag database... Done
The following NEW packages will be automatically installed:
  libglitz-glx1 libglitz1
The following NEW packages will be installed:
  libglitz-glx1 libglitz1 xserver-xgl
0 packages upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 0B/1843kB of archives. After unpacking 4854kB will be used.
Do you want to continue? [Y/n/?]

Once I logged out (and rebooted, for some reason my external monitor doesn’t always “catch” when I restart X) and back in again xGL was loaded and I was able to enable desktop visual effects. Despite my misgivings about using an embedded graphics chip it actually works really well. Windows bounced around, bent out of shape and did lots of nice animation stuff.

Then I removed the whole lot by uninstalling the xserver-xgl package again. Why? Unfortunately it conflicts with other openGL apps. In a toss up between fancy desktop effects and decent SDLMame performance, SDLMame wins hands down. It’s nice to know the visual effects work though!

How to umount when the device is busy

It happens all the time doesn’t it? You need to unmount a CD or you want to pack away the external drive but when you try to umount it you get the dreaded “device is busy” message. Wouldn’t it be great if Linux actually told you what was keeping the drive busy? Here we are in 2008, I’m using Ubuntu Gutsy, and that message hasn’t changed in all the years I’ve used Linux.

# umount /media/disk/
umount: /media/disk: device is busy
umount: /media/disk: device is busy

First thing you’ll do will probably be to close down all your terminals and xterms but here’s a better way. You can use the fuser command to find out which process was keeping the device busy:

# fuser -m /dev/sdc1
/dev/sdc1: 538
# ps auxw|grep 538
donncha 538 0.4 2.7 219212 56792 ? SLl Feb11 11:25 rhythmbox

Rhythmbox is the culprit! Close that down and umount the drive. Problem solved!

Ubuntu WiFi problems on the Dell D630 laptop

Wireless networking was always a bit patchy for me on my Dell Latitude D630 while running Ubuntu Gutsy version of Linux. It would work fine for ages and then freeze up suddenly, requiring a hard reboot to get things working (Apache would become unkillable, I guess because it was attached to the broken Wireless networking driver.) Problems always showed up when I transferred large amounts of data between Linux and my Macbook. Files copied fine for a few minutes and then the whole house of cards would collapse. Crash! Boom!

The first time I looked for a solution nothing turned up, but eventually I went searching again, and after digging into all sorts of forums and websites I found the simpe solution on the Dell Linux Wiki:

Create a file called /etc/modprobe.d/blacklist-ipw3945 and add:

blacklist ipw3945

Add to /etc/modules:

iwl3945

Reboot after doing that and all will be fine in the world again! I haven’t had any networking issues since replacing the ipw3945 driver with the iwl3945 one!

Donncha's Wednesday Links

Post digg.

  • Ireland’s Prime Minister or Taoiseach Bertie Ahern, recently received a nice pay rise of €38,000. He is now one of the highest paid heads of state in Europe. He even earns more than George Bush! Here are 50 ways his party, Fianna Fail, laugh at Irish voters. (via). Twenty Major elaborates on a possible discussion between Bertie and a member of Government. It’d be funny if it wasn’t based on fact. (via)
  • Damien is lusting after the Eee PC. Toni already bought one and he has the same complaints I had reservatioons about,

    * The screen and keyboard are tiny
    * I was hoping for a longer battery life (seems like it gets about 3 hours)

  • I Broke Blogspot.
  • How to scale WordPress MU is a work in progress. I’ve only skimmed it so far but I’ll dig into it later.
  • Make Linux look like a Mac is a Gnome theme with instructions and screenshots. Looks pretty.
  • Haha! Niall discovered that the Golden Spiders voting form only does Javascript validation. Vote as many times as you like! (sort of)
  • When I get older. What scares you most about the prospect of being old? Failing eyesight, hearing, physical disability? Memory loss or dementia?
  • The digging yesterday of my Super Cache post wasn’t as heavy as I thought it would be. More on that later.

Ubuntu Gutsy on the Dell Latitude D630

I previously documented my problems with Ubuntu and the DVD in the D630 but the upgrade to Ubuntu 7.10 Gutsy From Feisty went almost painlessly.

ubuntu 710 upgrade

All the packages downloaded and installed through the nice GUI front end. I was able to work away while they downloaded and for most of the time during install too, but when I rebooted I found that sound wasn’t working! I found this solution but I didn’t want to compile a kernel again. That’s so 90’s and this is 2007! Instead I checked my grub menu.lst and found there was an older 2.6.20 kernel listed there. A quick reboot later and sound works again, and it’s even louder! WiFi never stopped working thankfully but if you’re having problems, the page above explains what you need to install to get it working.

I haven’t tried the eye candy features yet, but so far the system feels springier and lighter, even with the old kernel. Let’s hope it stays that way!

Bah. GIMP 2.4rc3 broke a lot of the Script-fu scripts I use. I read about this somewhere. Time to get my hands dirty in my lomo plugin for starters.

Nice! Gthumb supports RAW images although it takes ages to initially process them initially.