Find the answer to your Linux question:
Results 1 to 3 of 3
Hi, I wrote a program in C that retrieves CPU temperature by accessing a port. This program works fine while logged in as the super user(root) but fails when logged ...
  1. #1
    Linux Enthusiast gerard4143's Avatar
    Join Date
    Dec 2007
    Location
    Canada, Prince Edward Island
    Posts
    714

    [SOLVED] user program with root privilege

    Hi,

    I wrote a program in C that retrieves CPU temperature by accessing a port. This program works fine while logged in as the super user(root) but fails when logged in as a user(non-root). My question is, how do I set this program up so that all users can run it?....Gerard

  2. #2
    Linux Engineer GNU-Fan's Avatar
    Join Date
    Mar 2008
    Posts
    935
    As root, you will have to set the SetUID bit for your application so that is has sufficient rights even if started by ordinary users.

    Users and Groups - The GNU C Library

    Be careful.

  3. #3
    Linux Enthusiast gerard4143's Avatar
    Join Date
    Dec 2007
    Location
    Canada, Prince Edward Island
    Posts
    714
    Thanks GNU-Fan...Gerard4143

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...