Determining NPTL version

Most recent linux distributions (CentOS 4, Fedora 3+, RHE 4, etc) are NPTL (Native POSIX Thread Library) based. If you want to check if your system is NPTL based, or only if you want to find out what version it is present in your kernel, you can use the following command:

getconf GNU_LIBPTHREAD_VERSION

Sample results:
On a Debian Etch system:

getconf GNU_LIBPTHREAD_VERSION
NPTL 2.3.6

On a RHEL4 system:

getconf GNU_LIBPTHREAD_VERSION
NPTL 2.3.4

For a detailed description on NPTL you can check wikipedia.

Tags: , ,

Linux Tips: The proper way to allow regular users to run commands as root

There are many situations when you will need regular users to have more privileges than the normal user account they have. What situations? This will depend very much on a case by case basis but believe me there will be such cases… For example if a regular user needs to run a program that will change some some protected folder or file, or just a special root command (like shutdown for example).
What can be done in such situations? Well this depends: if you can go around it by assigning proper file/folder permission then this is great. But if not:

  • you can give them the root password and place them in the group allowed to ’su’ and you are done. I never liked this option as it will allow them to do anything on the system, and this is not what we were trying to achieve.
  • you can use a program like sudo, to fine tune the proper commands that you will allow the user to run. This is more likely what I would do in this situation…

So the magical solution to this problem is sudo (superuser do), a program that allows a system administrator to give certain users (or groups of users) the ability to run some (or all) commands as root or another user. And all the commands will be logged for your reference.

The installation, in case you don’t already have sudo on the system, is very simple, but in case you want it you can check out some simple details about installing sudo on Debian, or Rhel, Fedora, Centos, and some details about the configuration files location and default state.
Read the rest of this entry »

Tags: , , ,