Re: setuid script



cesarino vinh <cesarinovinh77@xxxxxxxxx> wrote:
I just wanted to run my browser with a different user, because it's
safer :S

Safer than what...?


How can I do that? I'm using wright now the "gksu" - and then run as user...
so I can't make a shell script to do that, and I don't want to modify the
browser's executable, and I'm not in programming, but the solution is to
write an eg. C program to launch the browser, and then set SUID bit fot that
C app?

Use sudo and a script that sets up the environment appropriately

#!/bin/sh
#
# This script is safe ONLY if you can guarantee no other users are
# running programs on this system
####################################################################
#
xhost +local:
sudo -H -u otheruser DISPLAY="$DISPLAY" firefox "$@"

Then you add an entry in /etc/sudoers that allows you to sudo to the
user "otheruser" and run the firefox program (or whatever your preferred
browser is).

Chris


--
To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx
with a subject of "unsubscribe". Trouble? Contact listmaster@xxxxxxxxxxxxxxxx



Relevant Pages

  • logging a bash script using sudo and time
    ... I regularly run a script with time and sudo. ... example as `echo`) can be run as sudo by my user account without a ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
    (Debian-User)
  • Re: Dynamic loading of javascript files into web pages
    ... Steve says the technique is "safer". ... It is less safe because of the use ... than a <script> tag? ...
    (comp.lang.javascript)
  • Re: basic output question
    ... John Deas wrote: ... I want to call the script with arguments, ... Not only is this safer, it is also safer, because it will throw an error early if you feed it something other than an int. ...
    (comp.lang.python)
  • Re: Processing binary (BMP) files in gawk
    ... The script uses FS="" to convert the entire file into 331 078 single byte ... but it might have been safer to read the whole ... you don't run the risk of hitting a limit on the number of ...
    (comp.lang.awk)
  • Re: Does VBscript support " & _" for long strings?
    ... I think it's cleaner, safer and easier to read ... if it's done as a multiple concatenation: ... error in a script using this. ...
    (microsoft.public.scripting.vbscript)

Loading