Posts Tagged ‘Debian’

How-To fix the GPG error: “The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY”

Wednesday, February 6th, 2013

These are the few command-line instruction to fix the GPG Error (NO_PUBKEY) that may appear when trying to run the ‘apt-get update’ command on a APT based system:

“GPG error: http://some.site.com stable Release: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY SOMEGPGKEY

This issue may reveal itself when you want to source packages from a repository that is unknown by your copy of the GPG  database, therefore APT will consider the repository as an untrusted source.

If you are sure that the repository is safe, you can circumvent the error manually adding the site’s public key to your GPG database using the following commands:

don’t use sudo if you act as root
$ gpg --keyserver subkeys.pgp.net --recv SOMEGPGKEY
$ gpg --export --armor SOMEGPGKEY | sudo apt-key add -

Comments and feedbacks and ‘like’ are welcome as always!

How-To Configure Wireless LAN on RaspberryPi With Raspbian Kernel 3.2.27+ And Solwise RTL8188CUS WiFi dongle

Friday, September 28th, 2012


RaspberryPi and Solwise WiFi dongle RTL8188CUS chipsetThe configuration of WLAN with a RTL8188CUS dongle on RaspberryPi is quite trivial now. It doesn’t’ rely on esoteric scripts, of manual installation of third-party kernel modules anymore.

I’ve been digging the solution for days before, it came alone at the beginning of September with a release of new ‘firmware’ for the RPi (see ‘A little of Story’ at the end of the post).

The procedure to install and configure a wireless network interface with Raspbian requires as little as a system upgrade and minimal understanding of the ‘wpa_supplicant’ utility.

Prerequisites

  1. The RaspberryPi must be powered with a 2A output USB charger because the WiFi dongle is very energy-thirsty, especially when it’s scanning the network for available SSIDs or when it’s creating the connection with the assigned SSID.
  2. The RaspberryPi must be installed with Raspbian version 2012-08-16-wheezy-raspbian or greater.
  3. The RaspberryPi must be connected to the internet via the ethernet card.
  4. It’s advisable to have the ‘avahi-daemon’ package installed (and running)
  5. The WiFi Dongle must not be plugged to the RaspberryPi until specified in the following procedure.
  6. It’s better to use a USB extension lead to connect the WiFi dongle to avoid the RaspberryPi to self-restart if the dongle is hot-plugged (or hot-unplugged).

Notes

I did notice that when the WiFi dongle is installed and active, sometimes it interferes with the usb keyboard (with both normal and wireless keyboards).

System Preparation

If your RPi is running a Raspbian version greater than 2012-08-16-wheezy-raspbian you can skip the System Preparation.

  1. launch a repository update:
    $ sudo apt-get update
  2. run a system upgrade:
    $ sudo apt-get upgrade
  3. make sure that the latest RaspberryPi firmware version is installed
    $ sudo apt-get install raspberrypi-bootloader
    The recent RPi firmwares include the Linux kernel version 3.2.27+ or greater.
    On Raspbian the RPi firmware is packaged as ‘raspberrypi-bootloader
     
  4. Install the wpa_supplicant utility:
    $ apt-get install wpasupplicant

WLAN configuration and wpa_supplicant set-up

We suppose that the WiFi dongle will be recognised as the wlan0 device.

Under some circumstances it may be recognised as wlan1 (..or wlan2 on so on), in such case modify the configuration accordingly.

Otherwise if you want your system to forcibly recognise the dongle as wlan0 you will have to play with the /etc/udev/ configuration files.

  1. Generate a PSK version of your WLAN password with wpa_passphrase utility
    $  wpa_passphrase My_WiFi_SSID mypassword

    the output will be similar to

    network={
        ssid="My_WiFi_SSID"
        #psk="mypassword"
        psk=b2abb0fcd2f4527e11817de0823a57bb19ba4622f4595062c94ec4dd1370b5fe
    }
    This output is meat to be an entry for a network configuration blocks of a wpa_supplicant.conf file.
    By the way we e will use it differently.

  2. Copy the ‘psk’ value of the wpa_passphrase output
    i.e. b2abb0fcd2f4527e11817de0823a57bb19ba4622f4595062c94ec4dd1370b5fe
  3. edit the /etc/network/interfacesand add the wlan0 configurations as follow:
    ...
    
    auto wlan0
    allow-hotplug wlan0
    iface wlan0 inet dhcp
      wpa-ssid "My_WiFi_SSID"
      wpa-psk b2abb0fcd2f4527e11817de0823a57bb19ba4622f4595062c94ec4dd1370b5fe
    alternatively you can use the clear-text version of the password
      wpa-psk "mypassword"
  4. Shutdown the RPi.
  5. Unplug the ethernet cable.
  6. Plug the WiFi dongle in the RPi’s USB port.
  7. Restart the RPi and wait that it connects to the Wireless LAN.

If the dongle will lighten up and you can ping or ssh into the Raspbian, congratulations, you’ve done it!

A little of story:

The Linux kernel 3.x comes with the module rtl8192cu.ko that is not able to properly recognised the WiFi dongle with the RTL8188CUS chipset, and when plugging the device, the RPi will hang on device detection of may even freeze.

The most recent versions on the RPi firmware (Sep 2012) have removed the buggy kernel module, and substituted it with a ‘manually’ compiled module called 8192cu.ko probably sources from the source code available at Realtek home page.

 

How-To user EtherApe graphical network monitor with Windows, Mac OS X or Linux

Monday, February 14th, 2011

EtherApe is a graphical network monitor for Unix that come with most of the GNU/Linux distrubution but is not, now is present in MacPorts for Mac OS X and but has no porting for Windows as well.

The best use of EtherApe is when it’s installed on a server (or any GNU/Linux machine) connected to the last-hop of your network to allow it to ‘sniff’ (analyze) the whole traffic getting in-and-out of your network. I suggest to put it on the  switch or hub that connects your network to the router.

Normally we monitor and manage our network from our workstation trying to access as less as possible the screen of our servers. Because EtherApe would be installed on one of our servers to visualize its output on our screen avoiding the user of screen remotization like VNC, TeamViewer or LogMeIn we need to use X11 protocol forwarding via SSH.

This solution implies that we have and X11 service running on our workstation.
If we are working on a Linux machine it can’t be more easy as we mostprobably are working on a X11 implementation.
If run Mac OS X then we ned to installe Apple’s X11, and you can find the installer inside the Installation disc.

For Windows the game is more tough because it’s not a Unix based system and a X11 server implementation is not part of the standard applications offered as part of the installation options.
Fortunately come in hand the project Xming a free implementation of X Server for Windows: http://www.straightrunning.com/XmingNotes/

The steps to visualize EtherApe on your workstation are:

  1. Install EtherApe on your GNU/Linux server:
    i.e. on a GNU/Debian server: 

    # apt-get install etherape
  2. Install X11 on your workstation:
    1. On Linux most probably you have installed x.org package
    2. On Mac OS X you install the package that you find in the installation disc
    3. for windows you need to donlaod the public release of Xming:
      http://sourceforge.net/project/downloading.php?group_id=156984&filename=Xming-6-9-0-31-setup.exe
  3. Install an SSH client on your workstation
    1. On Linux and Mac OS X it is part of the base system installtion
    2. On Windows you need to install PuTTY:
      http://the.earth.li/~sgtatham/putty/latest/x86/putty.exe
  4. Enable X11 forwarding through SSH on your server:
  5. Edit the file /etc/ssh/sshd_config and add or modify the X11 forwarding setting to
    X11Forwarding yes

    then restart the SSH service to load the new configuration

  6. On Windows only configure Xming to connect via the SSH client to your Linux server and specify to run the program xterm (or any other terminal application you have installed on your server) and specify as connecting user root or any sudoer user because EtherApe needs root privileges to turn the network card in listening mode.
  7. run EtherApe from the ssh connection just fireing the command ‘etherape’

Have fun!

How-To flush the DHCP server lease cache

Monday, January 17th, 2011

On a GNU/Linux server locate the files  dhcpd.leases and dhcpd.leases~
Mine is a Debian so the location is /var/lib/dhcpd3/ .

  1. delete the temporary file dhcpd.leases~:
    $ sudo rm dhcpd.leases~
  2. flush the lease cache dhcpd.leases:

    $ sudo echo "" > dhcpd.leases

the next time the clients will request a lease they will probably obtain a different IP respect the one they had before.