Linux X screenshot using xwd

I'm trying to get the console (X display) screenshot from remote machine.
usera is login on the console and use display 0.0.
I want to get his screenshot.
I'm login using ssh as root, trying to:

prompt> xwd -root -out screenshot.xwd -display 0:0
Xlib: connection to "0:0.0" refused by server
Xlib: No protocol specified
xwd: unable to open display '0:0'

The same for:
prompt> xwd -root -out screenshot.xwd -display 127.0.0.1:0

Adding all to the xhost list fail:
prompt> xhost +
xhost: unable to open display ""
The system os in redhat 8 Linux.

Regards,
Addady

 

 

 

 

Top