Take a remote screenshot in Linux

If you need to take a screenshot of a machine and you only have terminal access – you can do the following:

DISPLAY=":0.0"; export DISPLAY; import -window root screengrab.png

Then you can download the file using SCP:

scp -P 22 sam@yourwebserver.com:screengrab.png ./screengrab.png

Moved from my other website: