<scanner>=/dev/scanner /dev/usb/scanner*
(Of course, make sure that /dev/scanner is really your scanner and not, say, your hard drive.)
That is the first step. The second step is to define what is done with those files. Look in the last section
of /etc/security/console.perms for lines similar to:
<console> 0660 <floppy> 0660 root.floppy
<console> 0600 <sound>
<console> 0600 <cdrom>
and add a line like:
<console> 0600 <scanner> 0600 root
Then, when you log in at the console, you are given ownership of the /dev/scanner device with the
permissions of 0600 (readable and writable by you only). When you log out, the device is owned by
root and still has the permissions 0600 (now readable and writable by root only).
27.5. Enabling Console Access for Other Applications
To make other applications accessible to console users, a bit more work is required.
First of all, console access only works for applications which reside in /sbin/ or /usr/sbin/, so the
application that you wish to run must be there. After verifying that, do the following steps:
1. Create a link from the name of your application, such as our sample foo program, to the /usr/
bin/consolehelper application:
cd /usr/binln -s consolehelper foo
2. Create the file /etc/security/console.apps/foo:
touch /etc/security/console.apps/foo
3. Create a PAM configuration file for the foo service in /etc/pam.d/. An easy way to do this is to
start with a copy of the halt service's PAM configuration file, and then modify the file if you want to
change the behavior:
cp /etc/pam.d/halt /etc/pam.d/foo
Now, when /usr/bin/foo is executed, consolehelper is called, which authenticates the user with
the help of /usr/sbin/userhelper. To authenticate the user, consolehelper asks for the user's
password if /etc/pam.d/foo is a copy of /etc/pam.d/halt (otherwise, it does precisely what is
specified in /etc/pam.d/foo) and then runs /usr/sbin/foo with root permissions.
In the PAM configuration file, an application can be configured to use the pam_timestamp module to
remember (or cache) a successful authentication attempt. When an application is started and proper
authentication is provided (the root password), a timestamp file is created. By default, a successful
authentication is cached for five minutes. During this time, any other application that is configured to
0640 root
0600 root.disk
Enabling Console Access for Other Applications
275
Need help?
Do you have a question about the ENTERPRISE LINUX 4 and is the answer not in the manual?