Ask a Question related to Linux / Unix Administration, Design and Development.

  1. #1

    Default suid - question

    Hello,

    hope, the following is not too elementary. My OS is Linux.

    I want to run a command like "fuser -9 -k /dev/lp0" in a shell script
    called i.e. reset_port, which has to be executable by
    non-superusers. The process blocking the device seems to belong to the
    user "lp". When executing the script as root user, the process using
    the device is killed as desired. But when running the script as a
    normal user, fuser /dev/lp0 neither shows nor kills the process.

    I have tried permissions which render the following attributes by
    ls -l (output truncated after user and group name):

    -rwSr-xr-x 1 lp lp
    -rwSr-sr-x 1 lp lp
    -rwSr-xr-x 1 root root
    -rwSr-sr-x 1 root root

    I understand, that suid (chmod u+s reset_port) should let the script
    run with superuser privileges, but in my case it does not work, so I
    guess, I have misunderstood something.

    Thanks for answers!
    Kay

    Kay Guest

  2. Similar Questions and Discussions

    1. Newbie Question: Biz Card Template Question
      Hi, I got the Pagemaker PlugIn - I am using one of the templates for Business Cards - the elements appear to be grouped (bound box all around when I...
  3. #2

    Default Re: suid - question

    On Thu, 01 Apr 2004 18:40:09 +0200, Kay
    <news_nospam@web.de> wrote:
    >
    > I understand, that suid (chmod u+s reset_port) should let the script
    > run with superuser privileges, but in my case it does not work, so I
    > guess, I have misunderstood something.
    >
    For security reasons, the suid bit is ignored on scripts. Try sudo.

    --
    Nothing is illegal if one hundred businessmen decide to do it.
    -- Andrew Young
    Bill Marcum Guest

  4. #3

    Default Re: suid - question

    Kay <news_nospam@web.de> wrote:
    > I understand, that suid (chmod u+s reset_port) should let the script
    > run with superuser privileges,
    No, on scripts you can't use the SUID bit. You need to use sudo
    within the script.

    Davide

    --
    | It would be nice if the Food and Drug Administration stopped issuing
    | warnings about toxic substances and just gave me the names of one or
    | two things still safe to eat.
    |
    Davide Bianchi Guest

  5. #4

    Default Re: suid - question

    In article <6w65cj8xee.fsf@pino.iskp.uni-bonn.de>,
    Kay <news_nospam@web.de> wrote:
    > I understand, that suid (chmod u+s reset_port) should let the script
    > run with superuser privileges, but in my case it does not work, so I
    > guess, I have misunderstood something.
    Most versions of Unix ignore setuid on scripts, because there are
    security implications of it.

    Use sudo.

    --
    Barry Margolin, [email]barmar@alum.mit.edu[/email]
    Arlington, MA
    *** PLEASE post questions in newsgroups, not directly to me ***
    Barry Margolin Guest

  6. #5

    Default Re: suid - question

    Barry Margolin <barmar@alum.mit.edu> writes:
    > In article <6w65cj8xee.fsf@pino.iskp.uni-bonn.de>,
    > Kay <news_nospam@web.de> wrote:
    >> I understand, that suid (chmod u+s reset_port) should let the script
    >> run with superuser privileges, but in my case it does not work, so I
    >> guess, I have misunderstood something.
    >
    > Most versions of Unix ignore setuid on scripts, because there are
    > security implications of it.
    >
    > Use sudo.
    >
    > --
    > Barry Margolin, [email]barmar@alum.mit.edu[/email]
    > Arlington, MA
    > *** PLEASE post questions in newsgroups, not directly to me ***
    Hello!

    Thanks for the answer, I was not very aware of this utility. Now I got
    it working.

    I should like to put a further question, which as well may be the
    result of a certain lack of understanding.

    sudo offers the possibility of letting user A run commands as user
    B. If NOPASSWD is not specified in the sudoers file, user A would have
    to know the password of user B, so that he could log in as user B
    anyway. Do I get it correctly, then, that this way of applying sudo
    would not make much sense?

    Cheers,
    Kay

    Kay Guest

  7. #6

    Default Re: suid - question

    Kay <news_nospam@web.de> wrote:
    > If NOPASSWD is not specified in the sudoers file, user A would have
    > to know the password of user B
    No. The password requested by sudo is user's A password. Sudo need
    to be sure that is user A trying to execute the command and not
    someone else that just stumbled into an open console. Otherwise
    the whole exercise is pointless and user A can just su - B and
    become user B with flying colors.

    Davide

    --
    | In a medium in which a News Piece takes a minute and an "In-Depth"
    | Piece takes two minutes, the Simple will drive out the Complex. --
    | Frank Mankiewicz
    |
    Davide Bianchi Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139