0

I am trying to monitor my laptop (Debian 8.7) when it is being used by someone else,I want to see what at any time people are running on my system & for this I'm trying to run a terminal command via SSH which captures the screenshot which I can view later.

I am using SSH client named JUICE SSH from my Android phone to login to my laptop but unable to execute any screenshot related commands.

I have tried scrot,gnome-screenshot,import but I'm unable to get the screenshot. The error with scrot says Can't open X display. It *is* running, yeah?

I checked my sshd_config file it had X11Forwarding set to YES searching internet I read that setting it to no should make it work but it did not happened either.

echo $DISPLAY var is :0.0

Ideas please?

2 Answers 2

1

Use the following command to take a screenshot using the android terminal:

DISPLAY=:0.0 import -window root screenshot.png
7
  • I tried this but gives me display: unable to open X server ' @ display. /some path/. Commented Apr 25, 2017 at 9:39
  • try this android application play.google.com/store/apps/details?id=org.connectbot Commented Apr 25, 2017 at 9:41
  • is this app dependent thing?I thought some server config problem it was Commented Apr 25, 2017 at 11:10
  • @techie_28 there is my sshd_config pastebin.com/YMSnZRaX Commented Apr 25, 2017 at 11:55
  • 1
    Adding "-silent" removes the beeping sound: DISPLAY=:0.0 import -silent -window root screenshot.png Commented Feb 4, 2020 at 16:38
0

You need privileges to spy on the screen of another user. Start by listing the access cookies of TARGET_USER:

$ sudo -u TARGET_USER xauth list
[...]
YOURHOST/unix:0  MIT-MAGIC-COOKIE-1  cc9413c4a3db83ef94647cfb2f1c2f4d
[...]

Choose the display you need (for the primary X console it's typically like the above line) and add it to your access list:

$ xauth add YOURHOST/unix:0 . cc9413c4a3db83ef94647cfb2f1c2f4d

(. is an abbreviation of MIT-MAGIC-COOKIE-1). You can then dump the display into a file (:0 is an abbreviation of YOURHOST/unix:0):

$ xwd -display :0 -root -silent -out root0.xwd

or show it directly if you've got your own X display (probably not if you SSH in from an Android system):

$ xwd -display :0 -root -silent | xwud

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.