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

Re: ssh -X authentication with sudo



> On 4/10/22 7:39 pm, Greg Wooledge wrote:
> > Change the sshd_config to allow direct root logins.
> > Then do ssh -X root@debian.box.
> >
> > If you're the paranoid type, or if the Debian system is exposed to
> > the public Internet, then make sure you only permit root logins
> > when using pubkey authentication, not password.  Then set up an RSA
> > pubkey for your direct root login.
> >  
> 
> To use the display without ssh root login. ssh as normal user to
> host. Then
> 
> echo $DISPLAY
> 
> su -
> 
> export DISPLAY=localhost:10 (or whatever your logged in user DISPLAY
> is set to)
> 
> xauth add $(xauth -f ~<your user name>/.Xauthority list | tail -1)
> 
> xhost

Thanks, that worked after a little fiddling. Firstly, /root/.Xauthority
didn't exist, so xauth complained. Touching the file sorted that. And
secondly, the .Xauthority file contained three lines and the one I need
was in the middle :( I suppose that was a result of previous fiddling
about I'd done resulting in extra logins. But removing the last entry
in the file (a) didn't immediately crash anything and (b) let xauth
work next time I ran it :) So success, and many thanks! Oh and

sudo su - of course.

PS as you surmised, I don't really want root ssh access.


Reply to: