[sudo-users] incorrect theme when using sudo

Paul Stepowski p.stepowski at qut.edu.au
Wed Mar 14 19:02:30 EDT 2007


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.

If you su to a user from root, e.g. sudo su - <username> ... you generally don't
need to type in a password.  However, su does require a valid (not locked,
password not expired, account not inactive) account, even if you run it from root.

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

Typically, people SSH in to a system and with "ForwardX11 yes" enabled, assuming
you're using an OpenSSH client.  This will set up your shell so that X is
tunneled over SSH.  X applications "just work" and the session is encrypted via
tunneled SSH.

Since you're performing an su to another user, you'll have to make sure your X
environment is set up correctly.  Check the DISPLAY environment variable etc.

> 
> 
> 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.

I'm assuming the theme is located in a hidden directory under your home
directory.  Something like ~/.galeon.   If the $HOME environment variable is not
being set, the application won't find the user's theme.  I'm not familiar with
galeon so I can't be more specific.

Thanks,

Paul

> 
> 
> 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
> 



More information about the sudo-users mailing list