3

In startos (with the ypkg packages), their app store somehow can download and install packages, without the prompt of any root or user password, to the root protected folders of /usr ...etc. However their command line program (using same package format) requires my password (I am a sudoer though).

My questions: Is there any way to do this with the ubuntu software center? How does this work? (allow a program root access without password from user)

1 Answer 1

3

Turn on the Set User ID (SUID) bit on the program:

sudo chmod u+s /usr/bin/software-center

Every time this program starts, it has the privilege of the owner (owner should be root to gain root powers). Any child processes that the program forks() will inherit the root privileges. This won't work however if the prompting of the password does not depend on the effective user id of the program (i.e. it's been programmed to always prompt).

2
  • ok cool, could you explain what u+s, as far as I know, is it user add setuid?
    – agz
    Jan 13, 2013 at 18:54
  • 1
    The 'u' tells chmod to modify the permission bits of the user (owner) of the file (type ls -l 'filename' on the terminal). The '+' means to add to the permission bits. The 's' means to turn on the setuid bit, meaning that whoever runs the file will have the permissions of the owner of the file.
    – WikiWitz
    Jan 13, 2013 at 19:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .