Answers to Quiz on chapter 1 of book Linux Device Drivers

Here is the solution to the Quiz on chapter 1 of book Linux Device Drivers

1. A device driver provides
Ans: Policy

2. A piece of code that can be added to kernel at runtime is called as
Ans: Module

3. /dev/conosle is a
Ans: Character Device

4. To link an object code dynamically to the running kernel we can use the command
Ans: insmod

5.Who is allowed to load modules into the kernel ?
Ans: Superuser

6.The linux is versioned under which license ?
Ans: GNU GPL 2

7.Which of the following is not a class of devi ce
Ans: String

8.Third party softwares should be treated with care to take care of the
Ans: Security of kernel

9.Is it possible to compile the linux kernel with not support for modules ?
Ans: Yes

10.Linux supports only i386 architecture true or false ?
Ans: False

Category: Linux | Comments Off on Answers to Quiz on chapter 1 of book Linux Device Drivers

Quiz on chapter 1 of book Linux Device Drivers (LDD3

Quiz on chapter 1 of book Linux Device Drivers (LDD3) body {margin: 10px;} Linux Device Drivers (LDD3) A device driver provides
Policy and Mechanism
Neither of them

A piece of code that can be added to kernel at runtime is called as
Kernel Code

/dev/consosle is a
Character Device
Block Device
Network Device
USB Device

To link an object code dynamically to the running kernel we can use the command

Who is allowed to load modules into the kernel ?
All users
No body

The linux is versioned under which license ?
No license

Which of the following is not a class of devi ce

Third party softwares should be treated with care to take care of the
Security of kernel
Look of the kernel
Language of the kernel
Length of the code

Is it possible to compile the linux kernel with not support for modules ?
Depends on the Compiler
Depends on the architecture

Linux supports only i386 architecture true or false ?
Depends on the compiler
It supports only one other architecture.

Category: Linux | Comments Off on Quiz on chapter 1 of book Linux Device Drivers (LDD3

How To List Packages From A PPA / Repository In Ubuntu

A few weeks ago, we saw how to find out to which PPA / repository a package belongs to in Ubuntu / Debian. But how about getting a list of packages available in a PPA / repository?

To get a list of packages available in a PPA / repository enabled on your system (if the repository is disabled or not added on your system, it won’t show up here), firstly install Synaptic if you haven’t already:
sudo apt-get install synaptic
(or install Synaptic GTK3)

Then open Synaptic, select “Origin” on the bottom left, then select a PPA or repository on the left and it should list all packages in that PPA / repository for your Ubuntu version, both installed and not installed:
Synaptic origin
In the latest Synaptic built with GTK3, there are two entries for each PPA here, one that uses “/now” at the end, which displays the packages you’ve installed from a repository and another one which displays all the packages available in that repository.
Important: if the exact same package (including the package version) exists in two or more PPAs / repositories, it will only be listed for one repository entry in Synaptic. That’s why I’ve added other ways of doing this (see below), which list all the packages, even if the package exists in other PPAs / repositories.

Command line
You can also do this using a command like the one below, but this will only list the package names, without any additional info (no version, description, etc.):awk ‘$1 == “Package:” { if (a[$2]++ == 0) print $2; }’ /var/lib/apt/lists/*PPA-FIRST-PART*PPA-SECOND-PART*Packages
where “PPA-FIRST-PART” is the first part of a PPA, e.g. for the ppa:nilarimogard/webupd8 PPA, “PPA-FIRST-PART” is “nilarimogard” and “PPA-SECOND-PART” is “webupd8”.

Let’s try it out:
awk ‘$1 == “Package:” { if (a[$2]++ == 0) print $2; }’ /var/lib/apt/lists/*nilarimogard*webupd8*Packages
And here’s the terminal output:

list packages ppa terminal
(I’ve tweaked the original command – see the credits -, to remove duplicate lines which would occur on 64bit systems with multi-arch support).
This works for regular repositories too, e.g. to see all the packages available in the proposed repository:awk ‘$1 == “Package:” { if (a[$2]++ == 0) print $2; }’ /var/lib/apt/lists/*proposed*Packages
Or, to see the packages available in the security multiverse repository:
awk ‘$1 == “Package:” { if (a[$2]++ == 0) print $2; }’ /var/lib/apt/lists/*security*multiverse*Packages

Using Y PPA Manager
Y PPA Manager, a small application I’ve created, can list all the packages available in each PPA added on your system. It doesn’t work with regular repositories (just Launchpad PPAs) though and the PPA needs to be enabled on your system for this to work. So it’s not perfect.
But there are advantages over Synaptic / the command above:
unlike Synaptic, it lists all the packages in a PPA, even if the exact same package (exact version) is available in multiple PPAs;unlike the command above, Y PPA Manager displays the package version next to the package name.
List packages PPA Y PPA Manager
To lists all the packages in a PPA, install Y PPA Manager:
sudo add-apt-repository ppa:webupd8team/y-ppa-manager
sudo apt-get update
sudo apt-get install y-ppa-manager
Then launch Y PPA Manager, double click “Manage PPAs”, select the PPA and click “List packages”.

some info via AskUbuntu & UsemosLinux

Originally published at WebUpd8: Daily Ubuntu / Linux news and application reviews.

Category: Ubuntu | Comments Off on How To List Packages From A PPA / Repository In Ubuntu

elementary OS Jupiter No Longer Available For Download, Makes Room for Luna

elementary OS jupiterJupiter, the first elementary OS release, is no longer available for download.
The elementary OS developers have said farewell to Jupiter today, taking the download page and Answers system offline temporarily. The reason behind this decision is the fact that being based on Ubuntu 10.10, Jupiter no longer receives security updates and is running outdated software:
Today, we’re announcing that we are officially bidding farewell to Jupiter to make room for Luna. Along with the download page, our current Answers system will be taken offline temporarily; it is designed to be a community-driven support system for the current release and will be brought back online for the release of Luna.

elementary OS lunaelementary OS Luna
But there’s some good news too! According to a comment posted by Sam Tate on G+, there are less than 15 bugs before a Luna beta release. So we should see an elementary OS Luna beta 1 release very soon!

Check out an older elementary OS Luna video HERE; there are some videos on the elementary OS blog as well.

first image via elementaryos

Originally published at WebUpd8: Daily Ubuntu / Linux news and application reviews.

Category: Ubuntu | Comments Off on elementary OS Jupiter No Longer Available For Download, Makes Room for Luna

Linux Restricted Shells: rssh and scponly

Restricted shells like rssh and scponly give sysadmin the possibility to limit the operations that Linux user can do, for example you can create user that will be allowed to copy files via scp but won’t be permitted to login into system’s command line. This is quite important security feature that should be considered by every sysadmin to prevent unauthorized activity by users for example over SSH.

If you have some online storage that is used for uploading backup data over scp or rsync/ssh from remote hosts then it is highly recommended to use restricted shells for those incoming connections and make sure that even if the attacker has got username/password (or key) then he (or she!) won’t be able to break into your system.

scponly is extremely simple restricted shell, user account that has scponly binary as its shell won’t be able to do anything except transfer data from remote host via scp protocol or via rsync/scp. rssh provides little bit more features: you can limit users to use selected protocols like scp, sftp, rsync, cvs or rdist either in chroot environment or not.


I prefer using yum or aptitude to install such kind of software like rssh or scponly so the fastest way is to try one of below commands depending on your needs:

apt-get install rssh
apt-get install scponly
yum install rssh
yum install scponly

If there are problems to find desired restricted shell in your Linux distro’s repository then you should download sources and do some ./configure, make and make install. Here are the links: latest rssh .tar.gz, latest scponly .tgz.


scponly doesn’t need any configuration and works out of the box so you just should set it as a shell for user account. Here are some examples.

Create new user account with scponly as shell:

useradd -s /usr/sbin/scponly user1

Modify user account to set rssh as a shell:

usermod -s /usr/sbin/rssh user2

Where /usr/sbin/scponly is binary executable of scponly.

rssh comes with text configuration file usually stored in /etc/rssh.conf. You can either setup per-user settings there or configure global restrictions for all accounts which are using rssh. Default rssh.conf file is well commented so there shouldn’t be any problems to configure rssh as you needs. At the same time, here are some examples.

If you wish to restrict all users to scp and rsync only then you should uncomment lines in rssh.conf like below:


Now coming to per-user examples. User peter is allowed to use scp protocol only, the following line in rssh.conf will do that:


User ann is allowed to scp, rsync only:


As you can see enabled protocols in per-user setup are specified as 11000 (scp, sftp), 11111 (scp, sftp, cvs, rdist, rsync) or 00000 (no protocols enabled). 022 in above examples specifies umask.


Let’s assume you’ve created user1 and enabled only scp and rsync using rssh. An attempt to access the server via SSH under user1 account will end with the following output:

artiomix$ ssh user1@
user1@’s password:

Category: Linux | Comments Off on Linux Restricted Shells: rssh and scponly

How to Remove Kerberos Password in Linux

This is a very rare situation one might face. Suddenly your linux based computer, VPS or server might prompt you to enter Kerberos Password. Same thing happened to me, I don’t remember if I had set kerberos password in the past. I had only updated certain packages. This happened when I tried assign new password to an existing vsftpd user. In this case all I could think of is getting rid of Kerberos password to proceed with my work.

Kerberos password is network authentication protocol which allow nodes communicating over a non-secure network to prove their identity to one another securely. Now to get rid of Kerberos password, all we need to do is removing a package that causes the issue. However this is a security feature that one might use if they are conscious about their data.

To remove Kerberos Password in Linux:

sudo apt-get remove –purge libpam-krb5

This will now remove the kerberos password.

Category: Linux | Comments Off on How to Remove Kerberos Password in Linux

Top 5 Password Managers for Linux [Guest Post]

In this post you will find set of password managers for Linux which provides secure storage for your passwords for sensitive data. If you still keep the passwords in plain text then you must consider one of available password managers so this article is for you.


KeePassX has been a very popular and famous password manager for Linux for a very long time and still trusted by pretty big number of users. When user launches the KeePassX password manager first it requires to set up of a master password to add an extra layer of security to password storage. As an option you can use a file with encryption key instead of the password. This key file can be used along with the master password to provide stronger security. KeePassX application is rather simple so you can easily create one or more databases which will have a master password and will contain all the login credentials stored encrypted. This manager is considered to be one of the most secure managers. If you’re Ubuntu user just type in terminal the following command:

sudo apt-get install keepassx

GPassword Manager

Gpassword Manager (GPM) is also one of the most secure and highly rated password managers which have more friendly and easy to use interface that KeePassX. This utility has many features that make it to be a good choice for most of the high level computer users. This password manager allows to set and add favorites into system-tray that is one of the unique features of this application. GPM utility uses the crypto++ method for encryption which can be used in Windows and Linux hence it enables the same database to be used on different platforms without the need to convert anything.

My Passwords

My Passwords is a simple and easy to use utility that allows you to store all your login credentials in an encrypted manner within a file. The most exciting feature of this utility are its speed and no requirement of an installation. Encryption algorithm that is used there is AES. Storage in Derby Database format along with AES encryption gives the user the power to create secure and fast password repository. The interface for this utility is fairly simple.

Fiagaro’s Password Manager 2

Fiagaro’s Password Manager 2 is another powerful tool with strong encryption methods that makes it one of the most secure utility for managing passwords in Linux. Fiagaro’s Password Manager 2 uses the AES-256 encryption of the database files which hold all your login credentials (it uses master password that should be set up once you started the program first).


Gringotts is rather old project: its application for Linux/Unix provides the user the possibility to store his or her notes in secure storage encrypted by symmetrical ciphers. Gringotts has a set of eight different algorithms that can be used to encrypt the desired data. This utility also provides different methods for hashing as well as compression. The interface of Gringotts is not as simple as of other password Managers but still easy to use and most effective for old school bearded Unix users.

About the author: Kelly Marsh is a blogger by profession. She loves writing on technology and luxury. Beside this she is fond of technology. Recently an article on Maruti Ritz attracted her attention. These days she is busy in writing an article on johnnie walker blue.

Category: Linux | Comments Off on Top 5 Password Managers for Linux [Guest Post]

Setting Up WiFi Connection Using WiCD

WiCD Logo

Often times Linux users find themselves wanting more from the network manager, especially laptop users on the move find it difficult to manage all the different networks they have access to. WiCD is one of the best tools for people wanting more. It’s gtk based network configuration tool, especially meant for wireless networks written in python. Apart from being dependent on gtk, it does not require any of gnome components to work. Rejoice all the openbox and fluxbox users.

Here’s what WiCD can do (taken from the official documentation),

Compatible with standard *nix networking commands (iwconfig, ifconfig, etc)
Once configured, will connect even if the X display does not start
Can be managed and configured via the command line using wicd-curses
Support for wired networks, as well as named profiles to save multiple wired configurations.
Supports configuring static IP addresses and DHCP on a per network basis
Store different static IPs, gateways, subnet masks, DNS server addresses per network
Automatically connect at boot – no user intervention required, even for encrypted networks
Keeps network keys in root accesible only (600) files (unencrypted, however)
Encryption (template based)

WPA 1/2

Automatically connects at resume from suspend
Displays information about the network
Ability to run scripts before/after connecting/disconnecting

All this and it’s really easy to use. Let’s start by installing WiCD, if you are an Ubuntu user, you can install WiCD very easily. All you need to do is open a terminal and issue following command,

sudo apt-get install wicd

This will install both WiCD with all the required dependencies. It will then ask you for the users you want to configure WiCD for. WiCD also comes with a tray icon. You can add it by right clicking a panel and choosing add to panel option then choose custom application launcher. Give it any name you want and in the command box type,


and you will have a tray icon now. Open WiCD and you will be greeted with a screen showing all the wireless networks in the range. You can then chose to connect to any network you want. If the network is protected by any security then you would have to chose the method of security in place and enter the correct key to connect to the network.

WiCD Networks

WiCD Networks

You, of course, also get the option to chose whether to use DHCP or static IPs, which DNS you want to use, which secondary DNS you want to use. gateways, subnet masks. You can also use it to manage wired networks.

WiCD Advanced

WiCD Advanced

And there’s more…

WiCD Advanced 2.0

WiCD Advanced 2.0

I for one have never had any problems with WiCD., although there are people who report certain incidents, it’s free from most major bugs and is a very solid program. One of my favourite distributions, Zenwalk, comes with WiCD pre-installed. Rest assured, this is a great tool to manage all your moving connection needs.

Category: Linux | Comments Off on Setting Up WiFi Connection Using WiCD

How to generate strong passwords in linux

passwordHow many times have you bothered about creating a strong password to your account? Be it an email account, server login, ssh or anything and everything that requires authentication. Usually, people create passwords that are easier to remember. But there are cases like database account, ssh accounts and other sensitive type of accounts where you need to create a password that is strong enough to resist any kind of password decryption methods used by hackers. Generating a password so strong can make you go bonkers. So you need something that generates a strong password automatically that is easier to remember as well.

Say hello APG.

It stands for Automated Password Generator. And as name suggests it is tool used to generate random passwords. APG houses two password generation algorithms. One is the Pronounceable Password Generation Algorithm (default) and the other is the Random Character Password Generation Algorithm. While the first generates strong passwords that are easy enough to remember since it provides you some clues on how to remember it, the latter just generates random passwords.

Installing APG

APG is literally available for any *NIX based operating system. In this tutorial, I will tell you how to install it on Ubuntu / Debian and Fedora / CentOS linux operating systems.

In Ubuntu:

In your terminal –

sudo apt-get install apg

In Fedora:

yum install apg

Using APG

Using APG is really simple. Let’s begin with simple password generation that is easy to remember and pronounceable, which is default. It will generated 6 passwords by using the random keyboard data you provide.

In your terminal,


APG will then prompt you to input some random data so that it can generate a password for you (eg. I like Do remember that these passwords will be generated randomly no matter who many times you provide the same keyboard input. So passwords won’t be the same every time. And as you can see the bracket, it provides a pronounceable clue to remember them.

OkBazCag4 (Ok-Baz-Cag-FOUR)
TabOgUt6 (Tab-Og-Ut-SIX)
novtarsEst7 (nov-tars-Est-SEVEN)
bowebcojCal5 (bow-eb-coj-Cal-FIVE)
AbrIbgan2 (Abr-Ib-gan-TWO)
eikkotVis0 (eik-kot-Vis-ZERO)

Now to generate random passwords that are not pronounceable, you need to use the -a 1 option. Where -a is the Algorithm and 1 selects random mode.

apg -a 1

This do not require any random keyboard inputs.


And finally to create a password that is really strong, really long (upto 63 characters) and really hard to break it, you need to make use of more options.

apg -s -a 1 -m 63 -n 4

This actually prompts you to enter some random inputs, but just hit “ENTER” key again to output the password.


This is really hard to remember as well, if you can, you got to be supernatural. To view all APG options, type man apg in your terminal.

Category: Linux | Comments Off on How to generate strong passwords in linux

Howto: Install Google Chrome Alpha in Ubuntu!

For the past couple of years I have been waiting and waiting for the possibility for a Google Browser, there has been rumors over the years and finally Google came out with Chrome. Unfortunately Google Chrome was only released for windows, only until now there is a semi working gui that is actually usable!! Yea I just logged into my gmail account 5 minutes ago with Chromium for Linux! Im impressed, I thought it would never get to this stage, but it has, currently there is allot of issues to be resolved like the sandboxing for example There is also quite a few issues that you can follow here

If you would like to help with its porting efforts you can go here

FAQ: no native 64bit debs planed for now. The amd64 package is using ia32-libs.

Anyways let me show you how easy it is to install and start browsing!

First lets add the chromium ppa, head over to here

Select your Ubuntu version in the drop down where you see:
Display sources.list entries for:

Then input those apt sources into System->Administration->Software Sources-> Click Third-Party Software Tab, then click +Add to add the apt sources

Now press ALT-F2 and enter gedit, paste this into gedit(its the ppa key for security)
Version: SKS 1.0.10

Now save the file and click +Import Keyfile on the Authentication tab of Software Sources, then click close. Then refresh your sources.

Click these packages to install them

Once installed Execute Chromium via Applications->Internet->Chromium Web Browser

Now enjoy using Google Chrome in linux, and watch it progress!

Category: Ubuntu | Comments Off on Howto: Install Google Chrome Alpha in Ubuntu!