Not able to open display of remote server if client is user and server is root
I am a user.
I log into remote server as a root using ssh -X. But I am not able to open display of server on my system. It gives following error. Code:
WARNING **: Unable to start: Cannot open display: If I log in to my system as root. Now I log into remote server as a root using ssh -X. I can open display of the server. But I can't log into my system as a root always.I have to solve the issue and I have to open the remote server's display on my system as a user. Please help me. Thanks. |
Did you check that X-forwarding is enabled for your user? This can be done by adding "ForwardX11 yes" to your $HOME/.ssh/config, as:
Code:
~$ echo "ForwardX11 yes" >> $HOME/.ssh/config Code:
~$ xhost +<remote_machine_hostname> |
Thanks Shivaa for your instant reply.
As I followed your process but I am still facing problem. Should I run these command on the specifically on the remote host or I can run this on remote host as a root log in through my system. because if I log in to remote host as a root from my system and run this command $ xhost +192.168.2.16 It says could not open display. Should I write remote host IP after xhost + or the IP of the client system. I am little confused. Please help. |
Login into your local system and invoke these comanands on local machine itself, and then connect to remote machine and try to import remote machine display on your local machine.
Code:
user@localmachine~$ echo "ForwardX11 yes" >> $HOME/.ssh/config |
First i have run this command as a user.
Quote:
Quote:
Quote:
|
I am still facing same problem, please help me.
I am explaining my problem again in short so anyone will not have to read all posts. I log into my system as a user and log into server as a root using ssh -X. Now I try to open display of the server on my system but it says. Code:
WARNING **: Could not open X display I can't log into my system as a root. I have tried above all solutions but I am still facing problem. Please help me to open display of the server on my system as a user. Any help would be grately appriciated. Thanks again. |
Have you exported DISPLAY variable? Try to execute this command on your localhost terminal. localhost terminal means When you log in to as user, then only run this command before log into server as a root.
Code:
username@hostname:~$ export DISPLAY='your-IP:0.0' |
What kind of your system is? Is it any particular type of server? And which desktop environment you're using (gnmoe/kde/xfce etc)? However, once login into your local system as normal user as well root both and invoke following command to check whether your DISPLAY varialbe is set properly or not.
Code:
user@localmachine~$ echo $DISPLAY |
Thanks for your replies.
@Karim - I have tried your command, it says Code:
** WARNING **: Could not open X display echo $DISPLAY - For root, it is blank Code:
[root@L177WSB ~]# echo $DISPLAY Code:
user@L177WSB:~$ echo $DISPLAY |
Output is blank for root and still you are able to access display successfully & :0.0 is set for user and still you are not able to access user.
I do not know but how can it be possible. Theoretically, it should not be happened. I have tried on my system right now and set blank variable using Quote:
I am not sure but are you sure about your details.:scratch: |
I do not know why experts don't believe me, this is my third thread where this is happening.:o
http://www.linuxquestions.org/questi...-c-4175463567/ http://www.linuxquestions.org/questi...ly-4175465964/ I had put screen-shot but still no one believed me. :( Both problems are still unsolved. Since it is not a support forum, it is a volunteer forum. members help if they can or if they want to, that's why I left the issue for now but one day I will create new thread again. I hope some one will not point out that "You have asked this question __ years/months before and you are still facing same problem" :( But you both have given your precious time, what can I ask more from you. I am really grateful. |
First thing I am not an expert, see my status, I am a newbie but yes, Shivaa is an expert and he is not the one who is not believing you, I wrote that.
Even you have more posts than mine and chronologically you are senior too. I had one more account here in which I had more than 225 posts and 50+ reputation but a member started Persecuting me. What I posted he criticized badly that's why I had to leave the account and I have created new one. Now he doesn't follow me anymore. but we are not discussing my problem, the thread is yours. I was not saying I am not believing you but what you are saying it doesn't look correct. Ok, try to execute these commands. Code:
username@hostname:~$ export DISPLAY='127.0.0.1:0.0' |
I had come accross this issue hundred of times during my work on VNC servers. There is no trick as such I know, but I guess somewhere something is missing from your side. However, once try as follow:
Login into your local system using normal user and invoke: Code:
user@localmachine~$ xhost + Code:
root@lremotemachine~# export DISPLAY='192.168.xx.xx:0.0' Code:
root@remotemachine~# export DISPLAY='localmachine.abc.org.com:0.0' |
Quote:
Code:
xauth add "$(/bin/hostname)/unix:0" MIT-MAGIC-COOKIE-1 $( xauth list "localhost/unix:0" | awk '{print $3}' ) The first thing is don't log in to ANYTHING as root. Log in as your regular user on your local system, and log in as the SAME user ID on the remote system, then run whatever command you want with "sudo <command name>". Logging in as root is always dangerous. See section 7 of this document for a better explanation of the .Xauthority file(s), and why doing remote X sessions as different users is difficult: http://www.faqs.org/docs/Linux-mini/...X-Apps.html#s7 A short version of things, some of which you seem to have done already:
Quote:
|
Quote:
He is nothing but a CowArt spiene-less Euunuchh who always stabs in back. Don't worry about him. I will take care of that sun of sut. You are a real diamond man. Your posts are really helpful. I am not going to take his name but the a-whole always says two things.' Spell Out your words' & No Idea what you are talking about. May be you encountered him many times. well leave it, you are a gem man, keep helping others. cháo |
All times are GMT -5. The time now is 02:57 AM. |