[sudo-users] incorrect theme when using sudo

janth at moldung.no janth at moldung.no
Wed Mar 14 16:14:47 EDT 2007


On Wed, Mar 14, 2007 at 10:49:40AM +0000, tony wrote:
> 
> Thanks for the reply, but I am having two problems with this solution.
> 
> First, su requires a password, and I want to run the command without a 
> password.


su - username requires usernames password
sudo su - username does not; when sudo runs su - username you are already root...


> Second, when running the command I get an "unable to open display" message, 
> even after executing "xhost +"

In sudoers: Defaults env_keep="DISPLAY XAUTHORITY"

Then type 'XAUTHORITY=~/.Xauthority ; export XAUTHORITY'
Verify with sudo xlogo, or other X application.

However, you will propably loose both DISPLAY and XAUTHORITY when su - runs, as
su - resets the enviromnet...
Does 'sudo su username -c /usr/bin/galeon' work?


-- 
Jan Thomas

> 
> I am curious to know what the difference is between running
> 
> sudo -H -u username /usr/bin/xterm
> $ /usr/bin/galeon
> 
> and
> 
> sudo -H -u username /usr/bin/xterm -e /usr/bin/galeon
> 
> Specifically, why one provides the correct theme and one not.
> 
> 
> Cheers.
> 
> Tony.
> 
> 
> On Wednesday 14 March 2007 00:17, you wrote:
> > Sudo does not perform a shell login when running commands.  So it will not
> > inherit shell settings such as environment variables, or run the ..profile
> > or .rc files.  Try something like
> >
> > sudo su - username -c /usr/bin/galeon
> >
> > Thanks,
> >
> > Paul
> >
> > tony wrote:
> > > I am trying to run Galeon as a different user, but it is not displaying
> > > the correct theme when it starts.
> > >
> > > This is what happens with various commands:-
> > >
> > > --------------------
> > >
> > > sudo -H -u username /usr/bin/galeon
> > >
> > >  - Galeon displays with default theme instead of username's theme
> > >
> > > --------------------
> > >
> > > sudo -H -u username /usr/bin/xterm
> > >
> > > Then in the xterm:-
> > >
> > > /usr/bin/galeon
> > >
> > >  - Galeon displays with username's theme
> > >
> > > --------------------
> > >
> > > sudo -H -u username /usr/bin/xterm -e /usr/bin/galeon
> > >
> > >  - Galeon displays with default theme instead of username's theme
> > >
> > > --------------------
> > >
> > > Does anyone have an idea of why the correct theme is only applied when
> > > Galeon is started from a running xterm? And can I get it to display the
> > > correct theme without using an xterm?
> > >
> > > Cheers.
> > >
> > > Tony.
> > >
> > >
> > >
> > >
> > > ___________________________________________________________
> > > All new Yahoo! Mail "The new Interface is stunning in its simplicity and
> > > ease of use." - PC Magazine http://uk.docs.yahoo.com/nowyoucan.html
> > > ____________________________________________________________
> > > sudo-users mailing list <sudo-users at sudo.ws>
> > > For list information, options, or to unsubscribe, visit:
> > > http://www.sudo.ws/mailman/listinfo/sudo-users
> 
> 	
> 	
> 		
> ___________________________________________________________ 
> All new Yahoo! Mail "The new Interface is stunning in its simplicity and ease of use." - PC Magazine 
> http://uk.docs.yahoo.com/nowyoucan.html
> ____________________________________________________________ 
> sudo-users mailing list <sudo-users at sudo.ws>
> For list information, options, or to unsubscribe, visit:
> http://www.sudo.ws/mailman/listinfo/sudo-users



More information about the sudo-users mailing list