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

Re: sudo in X-environment



On Thu, May 01, 2014 at 05:19:59PM +0000, Артур Истомин wrote:
> On Thu, May 01, 2014 at 05:46:36PM +0100, Tom Furie wrote:

> > 'xhost +' allows anyone anywhere access to your X server. If you must use
> > xhost in this situation it would be much safer to use 'xhost +
> > si:localuser:root', this would allow only root from the local machine to
> > connect. Just be sure to run 'xhost - si:localuser:root' as soon as you
> > are done. You can run xhost without any arguments to see exactly who is
> > alowed to connect to you.
> 
> Exactly :) But I am very lazy. It is very long string for me on my local
> machine with only one user =)

Here, have a wrapper script

--8x--------------------

#!/bin/sh

xhost + si:localuser:root
sudo $@
xhost - si:localuser:root

--8x--------------------

Save it as xdo and it's even less typing than 'xhost + ... xhost -' :)

Cheers,
Tom

-- 
Absence makes the heart grow fonder.
		-- Sextus Aurelius

Attachment: signature.asc
Description: Digital signature


Reply to: