简体   繁体   English

Linux-通过SSH隧道启动RecordMyDesktop

[英]Linux - launch recordMyDesktop by ssh tunnel

I made a script (name : "recordVideo") that launch recordMyDesktop to capture a window. 我制作了一个脚本(名称:“ recordVideo”),该脚本启动recordMyDesktop来捕获窗口。 this script is on a computer-1. 该脚本在计算机1上。 With computer-2 I want to launch the script with ssh. 对于computer-2,我想使用ssh启动脚本。 Here is my script on computer-1 : 这是我在computer-1上的脚本:

#!/bin/sh
cd /home/ivtuser/Bureau/
recordmydesktop --no-sound --delay 3 --windowid &(xwininfo -name "NAME_OF_WINDOW" | sed -n 's/.*Window id: \([0-9a-fx]\+\).*/\1/p')

I have set my parameters for ssh in ssh_config : 我已经在ssh_config中为ssh设置了参数:

ForwardX11 yes

and sshd_config : 和sshd_config:

X11Forwarding yes

And Xauth is installed on my PC. Xauth已安装在我的PC上。 I tried to launch in local mode for my test with ssh with this command : 我尝试使用以下命令在本地模式下使用ssh进行测试:

$ ssh -X localhost
password: XXX
$ recordVideo

And here is my problem, recordmydesktop stop with the response : 这是我的问题,recordmydesktop停止响应:

X Error: BadAccess (attempt to access private resource denied)

How can I fix this. 我怎样才能解决这个问题。 I'm lost Thanks 我迷路了谢谢

There are two solutions: 有两种解决方案:

  1. SUID SUID
  2. SSH as root SSH作为根

The first one is hard to get right without exposing your computer to security risks. 如果不将计算机暴露在安全风险下,第一个很难做到。

The second solution uses ssh root@computer-1 /path/to/recordVideo to log in as root and run the script as root. 第二种解决方案使用ssh root@computer-1 /path/to/recordVideo以root用户身份登录并以root用户身份运行脚本。

Also make sure the $DISPLAY variable is correctly set. 另外,请确保正确设置了$DISPLAY变量。 ssh -X should do that for you or you need to specify the option -display LOCAL:0.0 to all commands which connect to the X server (where LOCAL is the IP address or DNS name of the computer that you're sitting in front of). ssh -X应该为您执行此操作,或者您需要为连接到X服务器的所有命令指定-display LOCAL:0.0选项(其中LOCAL是位于您前面的计算机的IP地址或DNS名称) )。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM