LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 07-31-2016, 08:09 AM   #1
myoung
LQ Newbie
 
Registered: Nov 2010
Posts: 27

Rep: Reputation: 0
Question using two slackware computers how to ssh across, run xclock remotely and display locally


Hi,
I have two slackware 14.2 computers.
S1 is headless, ie no keyboard, mouse, display.
S2 is running KDE with a keyboard, mouse and display.
(I will use S1 and S2 to represent the host names of each computer)

I would like to ssh from S2 to S1,
then run a program, eg xclock, on S1 and have it display on S2.
Sounds simple and was easy and not a problem a few versions ago but now I can not get past the message:
Error: Can't open display: S2:0

I have tried:
S1# startkde
S2# KDE/XDM/X etc not running

S1# xhost +S2
S1# cat /etc/ssh/sshd_config | grep X11Forward
X11Forwarding yes

S1> ssh -X user@S2
or
S1> ssh -Y user@S2

-X generates:
Warning: untrusted X11 forwarding setup failed: xauth key data not generated

S2> setenv DISPLAY S1:0
S2> echo $DISPLAY
S1:0

S2> xclock
or
S2> xclock -display S1:0

Error: Can't open display: S1:0
--------------------------------

I assume someone has a web page on the internet somewhere showing how to do this but my googling has not found it!

Can someone/anyone point me in the right direction please?

If am going about this in completely the wrong way, I am open to alternatives to achieve the same result.

Thanks in Advance
 
Old 07-31-2016, 08:48 AM   #2
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
If X isn't running on S1, I do not believe that you will be able to get it to work.

I have 2 14.2 machines running in the house. Both are running X.
Code:
ssh -Y <other_machine>
xterm
popped up an xterm on this machine.

My remote machine has X11Forwarding yes set in /etc/ssh/sshd_config

Last edited by Richard Cranium; 07-31-2016 at 11:11 AM. Reason: gezley pointed out that X doesn't have to be running on S1.
 
Old 07-31-2016, 09:51 AM   #3
gda
Member
 
Registered: Oct 2015
Posts: 130

Rep: Reputation: 27
The following post may help:

http://www.linuxquestions.org/questi...7/#post5581576
 
Old 07-31-2016, 09:58 AM   #4
slacker1337
Member
 
Registered: Jun 2012
Location: Connecticut, USA
Distribution: Slackware
Posts: 148

Rep: Reputation: 40
I struggled with the same problem when I first starting re-using Slackware. After a long time of reading outdated information, I finally arrived at this:
https://adventuresinslackware.wordpr...-secure-shell/
 
Old 07-31-2016, 10:53 AM   #5
Gerard Lally
Senior Member
 
Registered: Sep 2009
Location: Leinster, IE
Distribution: Slackware, NetBSD
Posts: 2,177

Rep: Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761
Quote:
Originally Posted by myoung View Post
Hi,
I have two slackware 14.2 computers.
S1 is headless, ie no keyboard, mouse, display.
S2 is running KDE with a keyboard, mouse and display.
(I will use S1 and S2 to represent the host names of each computer)

I would like to ssh from S2 to S1,
then run a program, eg xclock, on S1 and have it display on S2.
Sounds simple and was easy and not a problem a few versions ago but now I can not get past the message:
Error: Can't open display: S2:0

I have tried:
S1# startkde
S2# KDE/XDM/X etc not running

S1# xhost +S2
S1# cat /etc/ssh/sshd_config | grep X11Forward
X11Forwarding yes

S1> ssh -X user@S2
or
S1> ssh -Y user@S2


-X generates:
Warning: untrusted X11 forwarding setup failed: xauth key data not generated

S2> setenv DISPLAY S1:0
S2> echo $DISPLAY
S1:0

S2> xclock
or
S2> xclock -display S1:0

Error: Can't open display: S1:0
--------------------------------
You say you want to ssh from S2 to headless S1 but if I'm not mistaken what you've tried above shows you doing it in reverse, from headless S1 to S2.

All you need to do is allow X11Forwarding on S1, and then ssh with X forwarding from S2 to S1:

ssh -Y user@S1

There is no need to export a DISPLAY variable; ssh will look after that for you. Once you ssh in to S1 just run xterm or xclock and the client will be displayed on S2. X does not need to be running on S1. Needless to say it does need to be running on S2.
 
Old 07-31-2016, 11:10 AM   #6
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
Quote:
Originally Posted by gezley View Post
X does not need to be running on S1.
I stand corrected then.
 
Old 07-31-2016, 12:22 PM   #7
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
X does not need even to be installed, only the app you want to run remotely with its supporting libraries.
 
Old 07-31-2016, 06:20 PM   #8
slacker1337
Member
 
Registered: Jun 2012
Location: Connecticut, USA
Distribution: Slackware
Posts: 148

Rep: Reputation: 40
Quote:
Originally Posted by Emerson View Post
X does not need even to be installed, only the app you want to run remotely with its supporting libraries.
Please correct me if I'm wrong, but dont you need the "x" package for xauth?
 
Old 07-31-2016, 09:05 PM   #9
Hangaber
Member
 
Registered: Sep 2004
Location: USA
Distribution: Slackware
Posts: 163

Rep: Reputation: 51
Quote:
Originally Posted by gda View Post
^ This.

If youre going for the X11 forwarding method then may not apply. However, using the "Plain Ol' Vanilla X11 Forwarding" method on http://docs.slackware.com/howtos:win...ex_linux2linux;

Machine S2 (local, not headless)
Code:
xhost +ip_of_S1
startx -- -listen tcp
Then on Machine S1 (remote, headless)
Code:
DISPLAY=ip_of_S2:0;export DISPLAY
xclock
Before I saw the post that gda linked to, I would get this kind of error;
Quote:
Error: Can't open display: S2:0
(Although as gezley points out, your error says S1 ... which is because you set DISPLAY or -display as the headless machine.)
 
Old 08-01-2016, 05:08 AM   #10
myoung
LQ Newbie
 
Registered: Nov 2010
Posts: 27

Original Poster
Rep: Reputation: 0
Smile

Thanks guys,
I had noticed that X did not seem to listening on port 6000 using this command:
S1> netstat -an | grep -F 6000
but I didn't know how to change that, so thanks "gda"
The magic command I was missing was:

startx -- -listen tcp

After restarting KDE with the above startx command, which I have now made an alias for startx
and following my normal procedure it all works nicely.

Excellent!
I wish I had asked earlier coz I have been googling on and off for weeks with no success :=)
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
SSH working locally but not remotely on Red Hat Enterprise Linux macd909 Red Hat 7 01-08-2012 08:00 PM
[SOLVED] SSH server problem. Can connect remotely but not locally Awesome Linux - Server 11 06-16-2011 02:27 AM
xen: Running Firefox remotely via ssh -X actually runs locally. ordinary Linux - Networking 9 02-27-2008 10:02 AM
After ssh'ing to self machine, unable to display xclock??? Passions Linux - Software 4 02-25-2008 04:12 PM
Howto use Postfix, Kmail locally, pine & ssh remotely ? chazza Linux - Software 0 12-27-2003 11:56 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration