[Bro] how to run as non-root user?

Jason Lee jrlee at lbl.gov
Fri Jul 15 15:09:26 PDT 2005


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


Hmmm,
On my linux (debian) system, su shows this:

jason at foobar[3:07pm](205)> su -l foobar
su: invalid option -- l
Usage: su [OPTS] [-] [username [ARGS]]
        -       make this a login shell
        -c, --command=<command>
                pass command to the invoked shell using its -c
                option
       -m, -p, --preserve-environment
                do not reset environment variables, and keep the
                same shell
       -s, --shell=<shell>
                use shell instead of the default in /etc/passwd


Cheers,
jason



Christian Kreibich wrote:
> Hi there,
> 
> I'm a bit puzzled about the problem as well, because according to
> 
> 
>>>   Unknown option: `-l'
>>>   Usage: tcsh [ -bcdefilmnqstvVxX ] [ argument ... ].
> 
>                             ^
> -l should work. Also, at least with GNU coreutils it doesn't make any
> difference whether you use 'su -' or 'su -l'. su puts the basename of
> the shell of the user that is su'd to into argv[0], prefixed with '-' to
> indicate a login shell.
> 
> Bash's and ksh's manpages mention this, tcsh's manpage is imprecise in
> saying argv[0] has to *be* "-" but its code only checks for the first
> character being '-' (or the -l flag, as the manpage says).
> 
> Best,
> Christian.
> 
> On Fri, 2005-07-15 at 13:48 -0700, Roger Winslow wrote:
> 
>>As for bro.rc it was written for 'sh' and is compatible with 'bash'.  That's why
>>the bang path is #!/bin/sh.  bro.rc was written to work on the widest number of
>>systems possible and sh/bash are available everywhere.
>>
>>I produced a simple shell script to simulate what you are referring to but was
>>unable to reproduce the error.  brouser has a shell of /bin/tcsh and root has a
>>shell of /bin/tcsh
>>
>>#!/bin/sh
>>
>>if [ "$1" = '1' ]; then
>>        echo DONE
>>        exit 0
>>fi
>>
>>su -l brouser -c "$0 1 < /dev/null"
>>
>>If you can find more info on the error I will look into it further.
>>
>>         Roger
> 
> 

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFC2DQW37vOcEqHLkARAuaEAJsFgHE9nKgYxD87GPFBQfaCMK5T2ACeLwMi
pVZOHjzWV1ShbbGC9NqLh3M=
=GSZm
-----END PGP SIGNATURE-----



More information about the Bro mailing list