LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   ssh X apps as root (https://www.linuxquestions.org/questions/linux-newbie-8/ssh-x-apps-as-root-852478/)

Mr. Alex 12-26-2010 12:51 PM

ssh X apps as root
 
When I SSH another machine and try to execute some GUI app, it does. But when I try to execute some app as root on a remote PC, it doesn't do and says:
Code:

X11 connection rejected because of wrong authentication.
[some-GUI-app]: Cannot open display:

How do I make it work?

phpdba 12-26-2010 12:55 PM

There are a few questions I would ask. On the machine you are trying to run a GUI app that you cannot, are you able to login directly as root or do you have to su to root? Do you have X11 forwarding turned on in the /etc/ssh/sshd_config file? Although I don't personally recommend it, do you have PermitRootLogin Yes on that same machine?

Mr. Alex 12-26-2010 01:04 PM

Quote:

Do you have X11 forwarding turned on in the /etc/ssh/sshd_config file?
Yes, I do.

Quote:

On the machine you are trying to run a GUI app that you cannot, are you able to login directly as root or do you have to su to root?
OK. I have a machine A and I'm trying to ssh the B machine. On the A machine I can type in "su" and get root privileges. I can also type in "su -", it also works. If I go to tty1 and login as "root" that also does.

Quote:

Although I don't personally recommend it, do you have PermitRootLogin Yes on that same machine?
You mean the B machine?
Here's the B's sshd_config:
Code:

$ cat /etc/ssh/sshd_config | grep -i PermitRootLogin
PermitRootLogin yes # (put yes here if you want root login)
# the setting of "PermitRootLogin without-password".

So I guess it's turned on.

phpdba 12-26-2010 01:27 PM

Hmmm...how are you exporting the display? Are you using putty to connect or is this a straight connect using xhosts to allow the display to show up on the other machine? I tend to cheat and use vncserver in the Centos world.

Mr. Alex 12-27-2010 12:15 AM

I connect from Linux to Linux with
Code:

$ ssh host@IP
and don't export anything. Should I?

Sayan Acharjee 12-27-2010 12:21 AM

See if this helps,

http://tldp.org/HOWTO/XDMCP-HOWTO/ts.html


All times are GMT -5. The time now is 03:00 AM.