Ssh – Error `No protocol specified` when running from remote machine via ssh

sshx11

I have a script, simply to run my Graphical (GUI) Application, as below.

#cat gui.sh
#!/bin/bash 
./gui -display 127.0.0.1:0.0    

When I run it from local machine (./gui.sh) it runs perfectly fine. But when I am trying to run it from remote machine via ssh, I got following error.

[root@localhost]# ssh -f 192.168.3.77 "cd /root/Desktop/GUI/ && "./gui.sh""   
No protocol specified  
gdm: cannot connect to X server 192.168.3.77:0.0   
[root@localhost]#    

I don't know, which protocol it is asking or am I missing anything? I tried directly by starting the application, without script [ssh -f 192.168.3.77 "cd /root/Desktop/GUI/ && "./gui""], but the result is same. I have tried various combinations like ssh -Y, ssh -fY and more but the result is same!
Secondly for my application, there is a must condition that, we have to first go into the directory where the program is located.
Any Solutions?

Best Answer

This video explains how to solve the error step by step. If you don't wan't to watch then follow the text below:

The No protocol specified error indicates that "the user doesn't know how to launch a GUI application" and the "user doesn't have permissions to launch a GUI application". In the video the GUI application is dbca.

The key piece of this video is in running the command xhost + which grants the user permissions to remotely display a GUI from a remote system, to the local system.

Related Question