0

I have 4 different raspberry devices that I have connect to 4 different monitors. The previous tech guy in my company had install and enabled vnc server to all of them, so he could remote desktop to them and run just one command.

rdesktop -f -d -k en-us -d ourdomain -u tv1 10.xxx.xxx.xx1

He was just connecting to each one to run the above command but of course with different user and terminal server. I was looking for a more convenient way to all of the above from my fedora box combine the power of sshpass and ssh. So first i tried

sshpass -p 'somepass' ssh pi@10.xxx.xxx.xx1

and then from the session I run

rdesktop -f -d -k en-us -d ourdomain -u tv1 10.xxx.xxx.xx1

but I got an error that said "failed to open display port" Now I know that this command's results or any other command's would be display in my terminal. So I tried some several alternations of ssh command but the result was either to see the rdsektop on my screen or the above error.

sshpass -p 'somepass' ssh pi@10.xxx.xxx.xx1 -t rdesktop -f -d -k en-us -d ourdomain -u tv1 10.xxx.xxx.xx1

or

sshpass -p 'somepass' ssh pi@10.xxx.xxx.xx1 -t -X rdesktop -f -d -k en-us -d ourdomain -u tv1 10.xxx.xxx.xx1

What I am looking to achieve here is to execute the rdesktop command on the remote machine and show on that tv screen the session that I created before. In few words. Bypass the vnc log in and do it all from ssh. Is there anyway? I know that somewhere I am wrong but I am not able to see where I am wrong.

  • Have you checked the history? – Canadian Luke Oct 18 '16 at 23:05
1

failed to open display port

That command indicates to me that you probably don't have X11 forwarding happening automatically. But you seem to be trying to run an X11 application from a remote system.

If you plan on running rdesktop from the remote system, then you need the SSH server to support X11 forwarding, you need the xauth package installed on the remote. You need to either adjust your ssh client config /etc/ssh/ssh_config or ~/.ssh/config or pass -X to your ssh command line to enable X11 forwarding from the client.

Running rdesktop from the remote machine might not be the best option though. You basically have all the overhead of an X11 session, plus all the overhead of a RDP session. You might be better of using the port forwarding features of SSH, then run a local rdesktop/freerdp client. That way you can skip the slowness that is typical for remote X11 sessions.

Of course the last note, I strongly suggest you reconsider your usage of sshpass. If at all possible you should be looking at using key-based authentication instead.

|improve this answer|||||
  • sshpass -p 'somepass' ssh pi@10.xxx.xxx.xx1 -t -X rdesktop -f -d -k en-us -d ourdomain -u tv1 10.xxx.xxx.xx1 – raism Oct 19 '16 at 2:00
  • the above command brings the rdesktop session to my screen....all I am trying to do is to do is execute the rdesktop on that remote machine and leave the rdesktop on that remote machine's screen. As for the sshpass advice thank you very much. I was considering to move on from that with key-based and certificate authentication procedure. – raism Oct 19 '16 at 2:05
  • all I am trying to do is to do is execute the rdesktop on that remote machine and leave the rdesktop on that remote machine's screen. - Is that computer running an X11 server? Is it logged in? Starting an application on a remote system to be displayed on a remote X11 takes a completely different command, which I don't know off the top of my head. – Zoredache Oct 19 '16 at 5:33
  • yes it has....its a raspbian os. That's why the previous tech was using vnc which I am trying to avoid. – raism Oct 19 '16 at 6:22
  • Any new ideas....I am still looking for a solution.....Do you need any more information ? @zoredache – raism Oct 24 '16 at 1:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.