You are not logged in.

#1 2005-06-12 19:18:11

nkw
Member
Registered: 2004-03-26
Posts: 80

Is X started?

I have a PC without monitor. I've set up the X but I still cannot run any X application in an ssh -X session.

[nick@myarch ~]$ xclock
Error: Can't open display: 
[nick@myarch ~]$ acroread 

(acroread:4637): Gtk-WARNING **: cannot open display:  

However, I can see the process X and xdm when using ps -A.

$ ssh -X -C nick@192.168.1.111
nick@192.168.1.111's password: 
Last login: Sun Jun 12 14:29:09 2005 from 192.168.1.3
[nick@myarch ~]$ ps -A
  PID TTY          TIME CMD
    1 ?        00:00:00 init
    2 ?        00:00:00 migration/0
    3 ?        00:00:00 ksoftirqd/0
    4 ?        00:00:00 events/0
    5 ?        00:00:00 khelper
   10 ?        00:00:00 kthread
   19 ?        00:00:00 kacpid
   74 ?        00:00:00 kblockd/0
  137 ?        00:00:00 pdflush
  138 ?        00:00:00 pdflush
  140 ?        00:00:00 aio/0
  139 ?        00:00:00 kswapd0
  141 ?        00:00:00 jfsIO
  142 ?        00:00:00 jfsCommit
  143 ?        00:00:00 jfsSync
  144 ?        00:00:00 xfslogd/0
  145 ?        00:00:00 xfsdatad/0
  146 ?        00:00:00 xfsbufd
  753 ?        00:00:00 kseriod
  842 ?        00:00:00 ata/0
  862 ?        00:00:00 kcryptd/0
  863 ?        00:00:00 kmirrord/0
  866 ?        00:00:00 reiserfs/0
  935 ?        00:00:00 udevd
 2270 ?        00:00:00 khubd
 2706 ?        00:00:00 syslog-ng
 4395 ?        00:00:00 crond
 4412 ?        00:00:00 sshd
 4433 ?        00:00:00 ntpd
 4453 ?        00:00:01 httpd
 4480 ?        00:00:00 agetty
 4495 ?        00:00:00 agetty
 4496 ?        00:00:00 agetty
 4497 ?        00:00:00 agetty
 4498 ?        00:00:00 agetty
 4565 ?        00:00:00 agetty
 4580 ?        00:00:00 xdm
 4597 ?        00:00:00 httpd
 4598 ?        00:00:00 httpd
 4599 ?        00:00:00 httpd
 4600 ?        00:00:00 httpd
 4601 ?        00:00:00 httpd
 4603 ?        00:00:03 X
 4604 ?        00:00:00 xdm
 4630 ?        00:00:00 sshd
 4632 ?        00:00:00 sshd
 4633 pts/0    00:00:00 bash
 4634 pts/0    00:00:00 ps

Offline

#2 2005-06-12 20:01:59

Cerebral
Forum Fellow
From: Waterloo, ON, CA
Registered: 2005-04-08
Posts: 3,108
Website

Re: Is X started?

Allrighty, to the best of my knowledge, this is how it works:

When running X applications through SSH, you do NOT need an X-server on the machine you're connecting to.  You DO need an X-server on the machine you're connecting FROM, though.

You also have to make sure SSHD allows X-tunnelling.  Check your

/etc/ssh/sshd_config

file on the server and make sure you have a line that says

X11Forwarding yes

in there somewhere.

So, machine A needs only SSHD running with X forwarding.  Machine B, with an X-server running, connects using ssh -X.

That oughta work for ya. wink

Offline

#3 2005-06-12 20:31:07

nkw
Member
Registered: 2004-03-26
Posts: 80

Re: Is X started?

Thanks, my X client (which using Cygwin-X) should works fine. I can connect other X Server and run X applications without any problem.

I changed the /etc/ssh/ssh_config on the X Server by adding two lines (the default one only has comment lines). However, I still cannot run X applications. I did /etc/rc.d/sshd restart

# Host *
#   ForwardAgent no
#   ForwardX11 no
ForwardX11 yes
#   RhostsRSAAuthentication no
#   RSAAuthentication yes
#   PasswordAuthentication yes
#   HostbasedAuthentication no
#   BatchMode no
#   CheckHostIP yes
#   AddressFamily any
#   ConnectTimeout 0
#   StrictHostKeyChecking ask
#   IdentityFile ~/.ssh/identity
#   IdentityFile ~/.ssh/id_rsa
#   IdentityFile ~/.ssh/id_dsa
#   Port 22
#   Protocol 2,1
#   Cipher 3des
#   Ciphers aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc
#   EscapeChar ~
ForwardX11Trusted yes

Offline

#4 2005-06-12 20:45:51

Stinky
Member
From: The Colony, TX
Registered: 2004-05-28
Posts: 187

Re: Is X started?

You also need to set

X11Forwarding yes

In /etc/ssh/sshd_config
Then restart sshd and try again.

Offline

#5 2005-06-12 21:06:42

nkw
Member
Registered: 2004-03-26
Posts: 80

Re: Is X started?

I added X11Forwarding yes
and reboot the PC, but it still doesn't work.
Maybe X problem?

# Host *
#   ForwardAgent no
#   ForwardX11 no
ForwardX11 yes
#   RhostsRSAAuthentication no
#   RSAAuthentication yes
#   PasswordAuthentication yes
#   HostbasedAuthentication no
#   BatchMode no
#   CheckHostIP yes
#   AddressFamily any
#   ConnectTimeout 0
#   StrictHostKeyChecking ask
#   IdentityFile ~/.ssh/identity
#   IdentityFile ~/.ssh/id_rsa
#   IdentityFile ~/.ssh/id_dsa
#   Port 22
#   Protocol 2,1
#   Cipher 3des
#   Ciphers aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc
#   EscapeChar ~
ForwardX11Trusted yes
X11Forwarding yes

Offline

#6 2005-06-12 21:12:30

Stinky
Member
From: The Colony, TX
Registered: 2004-05-28
Posts: 187

Re: Is X started?

What file are you changing?  You need to put
ForwardX11 yes in /etc/ssh/ssh_config

And
X11Forwarding yes in /etc/ssh/sshd_config.  Two different files.

Offline

#7 2005-06-12 21:25:24

nkw
Member
Registered: 2004-03-26
Posts: 80

Re: Is X started?

Problem solved. I was modifying ssh_config instead of sshd_config without thinking. Feel so bad. Anyway, thanks very much.

Offline

#8 2005-06-12 21:27:12

Stinky
Member
From: The Colony, TX
Registered: 2004-05-28
Posts: 187

Re: Is X started?

lol.  No, No.  Don't feel bad.  Glad you got it working!

Offline

Board footer

Powered by FluxBB