2013 juin 13
Remote acces to raspberry pi, X11 and sudo
12:12 - Par fabien tregan - Lien permanent
This morning my laptop stopped working, I switched to a mac mini, but hade only one monitor available.
The solution is rather simple (provided you have an X server running locally) :
ssh -X raspberry@192.168.0.42
it worked, but I could not sudo to start the python editor as root (which I needed to access /dev/spidev0.0 to play with my WS2801 led drivers).
One solution is (extracted from here):
Connect via ssh to the raspberry and :
apt-get install x11-xserver-utils
sudo touch /root/.Xauthority
Disconnect, reconnect and :
pi@raspberrypi ~ $ xauth list
This will show you some cookies values :
raspberrypi/unix:0 MIT-MAGIC-COOKIE-1 f0fdb32c00e54064bd5fe8969a6c227e
raspberrypi/unix:10 MIT-MAGIC-COOKIE-1 da868cd0f1f8b81b403562dc40f7bc1f
Then add the cookies to the root account :
sudo su
xauth add raspberrypi/unix:10 MIT-MAGIC-COOKIE-1 da868cd0f1f8b81b403562dc40f7bc1f
Wow, I can switch leds from a mac mini...