You are not logged in.
Pages: 1
Hey there guys, how can i run a program as a different user in fluxbox?
Offline
by using sudo?
Offline
dont know what sudo is or how to use it.
i have seen it in scripts though.
something that through a terminal, i can be logged into fluxbox and run a program as a different user (not root)
thanks
Offline
as root(probably!?)
# loginarch + gentoo + initng + python = enlisy
Offline
ok, did that.
logged in as another user ok. but it wouldn't allow me to execute a gui program . got a gtk warning that the display could not be opened
Offline
su usernameallows you to switch to any user in the terminal.
http://wiki.archlinux.org/index.php/Roo … %20Desktop
tells you how to enable GUI programs for other users. I'm pretty sure it works for all users, not just root.
HTH,
Dusty
Offline
very cool. thanks a lot
Offline
this will allow you to run applications as a different user in an X session. It's not mine - I got it from somewhere but I don't remember it anymore.
#!/bin/sh
# usage is:
# save as ~/script-name
# chmod +x script-name
# ~/xsu username 'programname &'
# ex:
# ~/xsu john 'firefox &'
if [ $# -lt 2 ]
then echo "usage: `basename $0` clientuser command" >&2
exit 2
fi
CLIENTUSER="$1"
shift
# FD 4 becomes stdin too
exec 4>&0
xauth list "$DISPLAY" | sed -e 's/^/add /' | {
# FD 3 becomes xauth output
# FD 0 becomes stdin again
# FD 4 is closed
exec 3>&0 0>&4 4>&-
exec su - "$CLIENTUSER" -c \
"xauth -q <&3
exec env DISPLAY='$DISPLAY' "'"$SHELL"'" -c '$*' 3>&-"
}Offline
xhost + ?
Offline
Pages: 1