[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: 'sux -c program username' does not work.



Hi Stu,

> $ sux -c kate edit
> Unknown id: eval $TERM;      exec env  TERM='xterm' DISPLAY=':0'
> "kate" "edit";
> 
> $ sux -m -c kate edit
> getent: invalid option -- c
> Try `getent --help' or `getent --usage' for more information.
> WARNING: --preserve-environment has been set, but no good value was
> found for XAUTHORITY, expect trouble
> Unknown id: eval $TERM;      exec env  TERM='xterm' DISPLAY=':0'
> "kate" "edit";
> 
> $ sux --help
> Usage: su [options] [LOGIN]

It looks like --help is passed through to su. Try
$ sux '-?'
usage: sux [-m|-p|--preserve-environment]
           [--display display]
           [--no-cookies|--copy-cookies|--use-xauthority]
           [--untrusted] [--timeout x]
           [-] [username [command]]

So you would need 
$ sux root kate


As an alternative, set up sudo and run
$ sudo kate

Or for the specific case of running an editor, use sudoedit with your
chosen editor in the EDITOR environment variable e.g.
export EDITOR=kate
$ sudoedit filename


I hope this helps.


Reply to: