Technical article 105275

How can I allow users to enable and disable tty devices? (Or: How can I allow users to run a script as root?)

OpenServer 6.0.0OpenServer 5.0.0OpenServer 5.0.2OpenServer 5.0.4OpenServer 5.0.5OpenServer 5.0.6OpenServer 5.0.7

Written · Last revised

Problem

How can I enable(C) and disable(C) /dev/tty devices as a regular
user instead of as a superuser?  When trying to enable and disable
as a regular user, I get the error:
Insufficient authorization for attempted operation

Solution

You can use the asroot(ADM) command.  In order to grant a user
the right to enable and disable tty devices, take the following
steps while logged in as root:
1. Since enable and disable are setuid(S) commands, asroot
must run them from a shell script.  Create the following files
in the /tcb/files/rootcmds directory:
enable
which should have the line:
/usr/bin/enable $*
disable
which should have the line:
/usr/bin/disable $*
The permissions on both files should be -r-xr-xr-x.  You can
change this with the chmod(C) command.  Perform this command:
chmod 555 enable disable
in the /tcb/files/rootcmds directory.

2. Edit the file /etc/auth/system/authorize. (See authorize(F)). Find the line that reads:

root:shutdown

Add enable and disable to the end, separated by commas:

root:shutdown,enable,disable
3. Go into Account Manager and highlight the user you want to
allow to use enable/disable.  From the User menu, choose
Privileges and add execsuid to the list of allowed privileges.
Now choose Authorizations from the Users menu and add enable
and disable to the list of allowed authorizations.  If enable
and disable do not show on the list, verify the steps in 2).

4. When users have been granted enable/disable authorization, they can use the enable/disable commands by running asroot(ADM) with the following syntax:

/tcb/bin/asroot enable tty1A
NOTE:     To allow a user to enable and disable printers, you only need to
          grant them "lp" authorization in Account Manager.  They will then
          be able to run enable and disable on printers without using asroot.

See also

asroot(ADM), enable(C), disable(C)

From the Xinuos technical article database, record 105275. Reproduced with permission. The original is at www.sco.com/ta/105275, which is reachable but blocked from search engines.

Next step

Need this fixed rather than explained?

Tell us the release, what the system runs and what it is doing. We will reply by email with what we would do next.

  • You deal with the people who do the work
  • No obligation, and no upgrade required before we will help
  • We tell you plainly if something is not worth doing

Send an enquiry

We reply by email. If a server is down, say so in the first line. You can also write to help@scoexpert.com.