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-07-2003, 11:09 PM   #1
digital bots
Member
 
Registered: Feb 2002
Distribution: Slack 10.1
Posts: 215

Rep: Reputation: 30
how do you get X-windows when you log on though ssh?


I resently loaded ssh on my slackware and i got it running. I am currently using putty to get into my box over the network. I was just wondering thou is there away to run the KDE X Windows system while logged in with SSH though putty? I tried typing startx but all it does is give me a read out of commands on the screen.
 
Old 07-07-2003, 11:34 PM   #2
contrasutra
LQ Guru
 
Registered: Mar 2003
Location: New Jersey
Distribution: Arch Linux
Posts: 1,445

Rep: Reputation: 47
I don't think you can. You'll need something like VNC for that.

realvnc.com
tightvnc.com
 
Old 07-07-2003, 11:35 PM   #3
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Might be possible with Cygwin/X ;) or some
commercial product like Hummingbird eXceed,
I don't think winDOHs and putty will do
the trick.


Cheers,
Tink
 
Old 07-08-2003, 12:53 AM   #4
linuxJaver
Member
 
Registered: Jul 2003
Location: Jakartax, ID
Distribution: slack9.1+,9.1,rh9
Posts: 203

Rep: Reputation: 30
Let me try to guess those errors: it must be something related to the DISPLAY environment variable, if not then I can just write according to my experience how it worked by me ..

First of all startx is for starting the X-server, if it is already started on the remote site, then u ll surely be pointed that it is already a X running there. I don't know about vnc concept:

From now on refer <remotehost> to the hostname/ip of the host where the remote host is without <>, n refer <localhost> to the hostname or ip of ur running slack without <>.
X-server, shh-server must already running on remote side. Then run startx on ur <localhost>, pop out a xterm or konsole, type: xhost +<remotehost>, then log into <remotehost> with: ssh <remotehost>.

After loged in, now u r in the remoteshell. Wut u need now is to set the environment variable DISPLAY of the remoteshell to use the display of the <localhost>. To see the defined environment variables of the remoteshell just type: env

Now, type in the remoteshell:
xhost +<localhost>
export DISPLAY=<localhost>:0

If ur default shell on the remoteshell is tcsh, then type:
setenv DISPLAY <localhost>:0

If thing functioned well, u ll then able to call the remote X-clients to run on ur local slcak, like: xterm, netscape, mozilla, ... just try out.

If the remotehost is solaris, I just put this below on my ~/.bashrc on <remote account> to automatically do the story above.

if [ $REMOTEHOST ]; then
/usr/X11R6/bin/xhost +$REMOTEHOST
export DISPLAY=$REMOTE_HOST:0
fi

For csh/tcsh shell put below on ~/.cshrc

if ( $REMOTEHOST ) then
/usr/X11R6/bin/xhost +$REMOTEHOST
setenv DISPLAY $REMOTEHOST:0
endif

That must be in the remote site, not on local (where slack running)!

That is the common concept with X-server, X-client. It is possible because X is designed to be transparent. U can even ssh from xterm invoked from the <1st-remotehost> to another host <2nd-remotehost> every where on the internet where u have shell-account, as long as X-server is running there. Then just do the set DISPLAY variable procedure like above.

Note:
It is normal to set the DISPLAY of <2nd remotehost> to the display of ur <localhost> (where slack is running). But it is also possible to set it to the display of the <1st remotehost>, wut meant wut u invoke from the <shell of the 2n remotehost> will be pop out on the screen of the <1st remotehost> if someone ist running X-client on there, supposed he/she didn't blocked the screen with the authority-cookie (xauth uses ~/.Xauthority). But most likely his/her screen will already protected from this scene, when he/she started X with the startx script. Startx start invoke xinit, which in turn will start /usr/X11R6/bin/xauth somewhere normally .. (See those /usr/X11R6/lib/xinit/*) ..

By microsoft platforms, that means u ll run like ms-word.. from a window-server (somewhere on the internet) n have it displayed on ur local screen. They call it vpn, likely, am not sure. But is it possible to invoke another client from a 2nd server from within the 1st-terminal/shell of the 1st-server on vpn ?

The X-client/server concept worked since the X released maybe even since release X11R5 or even R4 or R3 .. back to 1980 .. ..

So that scene should work for common X-clients, I don't know whether u can have kde/gnome clients running through .., afaik kde/gnome sit only above the X-server. If not I ll not comment further..

Last edited by linuxJaver; 07-08-2003 at 08:27 AM.
 
Old 07-08-2003, 02:16 AM   #5
Locura
Member
 
Registered: May 2003
Distribution: Ubuntu 6.10 SE, Mac OS 10.4.8
Posts: 370

Rep: Reputation: 30
I think he wants to know if it's possible to view X on a Windows machine, which he is using to SSH into his linux box.

Something like that MAY work for cygwin, but you would have to install ssh on cygwin and use THAT to connect to your remote box. You would have to start up X from cygwin, and then open up a terminal and ssh into your linux box and do the stuff with the DISPLAY variable to point X apps from that machine to your local machine's X session running on cygwin. I've never done something like that before though so I am not positive it would work.
 
Old 07-08-2003, 04:42 AM   #6
Noryungi
Member
 
Registered: Jul 2003
Location: --> X <-- You are here.
Distribution: Slackware, OpenBSD
Posts: 305

Rep: Reputation: 53
You can use SSH to run X Windows remotely.

However, this works best between two Linux machines, not between one Linux and one Windows machine.

In any case, you'll need an X client installed on your Windows machine (another person mentioned some possibilities above).

For more information, please refer to the following articles, I think they should be helpful:

http://www.hackinglinuxexposed.com/a.../20030228.html
http://www.hackinglinuxexposed.com/a.../20030309.html
http://www.hackinglinuxexposed.com/a.../20030316.html

Hope this helps!
 
Old 07-08-2003, 05:13 AM   #7
kuyalfinator
Member
 
Registered: Jul 2003
Location: Los Angeles
Distribution: RedHat8 2.4.18-14 RedHat9 2.4.20-8 FreeBSD 5.2.1 Ubuntu 10_4 Mandrake 2.4.21-0.13mdk
Posts: 118

Rep: Reputation: 16
Windows Can have a Linux / Unix Desktop

Visit this site at http://www.labf.com

First paragraph of the site:

"Where to start?

If you are new to working with the Windows and Linux / Unix connectivity issue, there are two excellent articles we recommend you to start with. The first one, "Windows onto Linux" is written by Ashton Mills for APC Magazine. (Please be patient - the link might take few seconds to open.) The second article, "WinaXe: Linux Hand in Hand with Windows", written by Dinesh Yadav, was featured in the LinuxForYou Magazine in March 2003. Now that you have familiarized yourself with WinaXe, you are ready to download and try the software. After having fun with the trial version, you are propably eager to take the last step: Purchase the license!."


The first paragraph points you to two links:

Is in HTML format
http://www.apcmag.com/apc/apcmag.nsf...256B26007F34EE

The other link is a pdf that is similair to the html version.

Code:
Last login: Mon Jul 07 2003 20:18:38 -0800 from dhcp166-193.cal
Sun Microsystems Inc.   SunOS 5.8       Generic February 2000
No mail.
Sun Microsystems Inc.   SunOS 5.8       Generic February 2000
TERM = xterm

Filesystem     usage  quota  limit    timeleft  files  quota  limit    timeleft

                4134  10000  10300                754  20000  20600
bash-2.03$ uname -a
SunOS mars 5.8 Generic_108528-19 sun4u sparc SUNW,Ultra-Enterprise
The code above is the login prompt of the SunOS Solaris 8.0 I use through ssh. But, a program we use to get the GUI desktop of the SunOS CDE 1.4 is a program called XSession or WinaXe from www.labf.com We can have both the Windows GUI with the SunOS GUI.

Linux has a GUI login, but needs to be configured called X11. The site with the articles describes the setup as well.
 
Old 07-08-2003, 08:05 AM   #8
pr1sg
LQ Newbie
 
Registered: Feb 2003
Distribution: Debian
Posts: 17

Rep: Reputation: 0
No, don't use xhost. Not secure at all. The whole point of ssh is secure remote logins. An added bonus is that ssh handles all the $DISPLAY stuff for you, so you don't have to touch it.
I had the same problem, and here's how I did it after STFWing.
First, install Cygwin on your Windows machine. http://www.cygwin.com/ Make sure to install the X environment, the ssh library (I believe it's called openssh or openssl or some such), and bash (you don't have to but I just like it).
Obviously, make sure that your Linux box is running sshd, which will listen for incoming ssh connections. ps or ncps will tell you if you are. If not, start it. Also be sure to enable packet forwarding. Go into /etc/ssh/sshd_config
and set the following:

X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost yes

and restart sshd. (for more info, see http://www.linuxquestions.org/questi...ight=sshd.conf)
Then fire up Cygwin on your Windows box. It will think for a while, and put you in a nice CLI. From there,

startx

This (after some thinking) will put you into a familiar grey-looking X and some bash sessions. If you get error messages, reinstall Cygwin and make sure you have the components I mentioned above. Then issue

ssh -X your_Linux_box_ip_address_or_domain

This tells ssh to forward X packets from your Linux box to the X session under Cygwin. Consult man ssh for more info.

This is it. Test it:

xeyes

If you get connection refused messages, make sure sshd is configured properly. Again, man ssh.


Good luck.
 
Old 07-08-2003, 09:07 AM   #9
linuxJaver
Member
 
Registered: Jul 2003
Location: Jakartax, ID
Distribution: slack9.1+,9.1,rh9
Posts: 203

Rep: Reputation: 30
I've just looked on the manual page of ssh (man ssh). I remembered the last time I hooked on a remote solaris machine from slack. The server forced me to create such keys something, I need to just do it once for each host I try to connect to. The key creation is forced automatically during the ssh session.
After login, the channel is already encrypted, save from spoofing issues. I'ven't tried those X11* stuff config (dun know whether those functioned on linux not cygwin, I mean if I've to use cygwin to get unix environment, then I ll better forget about using unix at all, sorry for me pc is good when it can be configured to be like unix machine, with those unix-commands, bash/tcsh natively... Therefore ms-boxes ll be good enough if they implement all unix commands n support bash/tcsh natively not command.com or cmd.exe...

If such X11* stuff configuration on ssh work, they r surely the prefered option. Afaik xhost is just for telling the remote X-server to add localhost to his "network-neigbour", but all data is already encrypted by ssh through the channel, isn't it ? Can try both without n without ..

But please not with cygwin, please. I prefered postgressSql over mySql, but on Window postgressSql only works on cygwin, that have demotivated me for awhile ..
Since 3, ..2 years ago I back from linux to use winodws, bcoz it is so hard to get linux-boxes to get connected to internet, etc, etc .. But I wondered, during the last installation of slack9, rh9, I got hooked on internet immediately after the installation..

That mean it is now the prime time to forget the ms-boxes, but not at all. I still need them to test java thingies, most web clients still running on ms-boxes... That is wut they actually good for, from now on !!!

Last edited by linuxJaver; 07-08-2003 at 09:26 AM.
 
Old 07-08-2003, 11:31 AM   #10
pr1sg
LQ Newbie
 
Registered: Feb 2003
Distribution: Debian
Posts: 17

Rep: Reputation: 0
Quote:
Originally posted by linuxJaver
I've just looked on the manual page of ssh (man ssh). I remembered the last time I hooked on a remote solaris machine from slack. The server forced me to create such keys something, I need to just do it once for each host I try to connect to. The key creation is forced automatically during the ssh session.
Yes, this is standard ssh authentication, which is really the point of using ssh.

Quote:
After login, the channel is already encrypted, save from spoofing issues. I'ven't tried those X11* stuff config (dun know whether those functioned on linux not cygwin, I mean if I've to use cygwin to get unix environment, then I ll better forget about using unix at all, sorry for me pc is good when it can be configured to be like unix machine, with those unix-commands, bash/tcsh natively... Therefore ms-boxes ll be good enough if they implement all unix commands n support bash/tcsh natively not command.com or cmd.exe...
Well, I suppose to each his own. However, the question here really is, given a Windows and a Linux machine, how do we get them to exchange X packets? One solution is to wait N years for Microsoft to implement X natively in Windows. Another is to use a POSIX-type layer under Windows. Cygwin is just one of them, and I use it because it happen to works for me. I am sure there are other tools that achieve the same goal, but I don't believe you can do away with such tools completely.

Quote:
If such X11* stuff configuration on ssh work, they r surely the prefered option. Afaik xhost is just for telling the remote X-server to add localhost to his "network-neigbour", but all data is already encrypted by ssh through the channel, isn't it ? Can try both without n without ..
It certainly works, that's how I log into my computer every day from work.
xhost isn't the best way to do it. When you do

xhost +remotehost

anybody with half a brain can pretend to be that remotehost and get access to your X environment. Better yet, why not do

xhost +

and put up a welcome sign?
It is much harder to do so if you are using ssh, in which case you don't need xhost at all.
Another handy thing port forwarding via ssh can do is that it is not limited to Box L --> Box W. You can have a rather large number of computers in between, something like this:

Box L1 --> Box L2 --> Box L3 --> .. > Box W

I actually use this as well - I am behind a firewall which doesn't allow outgoing connections on 22 to some hosts, but if I ssh to a trusted host first, I can ssh into my home computer from there, and X packets are forwarded merrily. You can try to set $DISPLAYs on all these machines (what if Box L2 doesn't have an X environment at all?), or use ssh and save yourself a lot of time.
 
Old 07-08-2003, 05:58 PM   #11
linuxJaver
Member
 
Registered: Jul 2003
Location: Jakartax, ID
Distribution: slack9.1+,9.1,rh9
Posts: 203

Rep: Reputation: 30
Quote:
Quote:
After login, the channel is already encrypted, save from spoofing issues. I'ven't tried those X11* stuff config (dun know whether those functioned on linux not cygwin, I mean if I've to use cygwin to get unix environment, then I ll better forget about using unix at all, sorry for me pc is good when it can be configured to be like unix machine, with those unix-commands, bash/tcsh natively... Therefore ms-boxes ll be good enough if they implement all unix commands n support bash/tcsh natively not command.com or cmd.exe...
Well, I suppose to teach his own. However, the question here really is, given a Windows and a Linux machine, how do we get them to exchange X packets? One solution is to wait N years for Microsoft to implement X natively in Windows. Another is to use a POSIX-type layer under Windows. Cygwin is just one of them, and I use it because it happen to works for me. I am sure there are other tools that achieve the same goal, but I don't believe you can do away with such tools completely.
No, the 1st question is not about connecting from a window-box to a remote X-server, but from slack ... Am not against Cygwin, it is cool that they made it so far that ppl can even have the X enviroment on a window-box, wut I meant is if one is considering to work seriously with unix environment (using X-client/server should be considered to be) then instead of to have such emulaaated linux environment, one should consider to have the real box installed.

I just gonna introduced the X-client/server concept, if ssh enabled the xhost feature then it is naturaly preferable..

Quote:
Box L1 --> Box L2 --> Box L3 --> .. > Box W

I actually use this as well - I am behind a firewall which doesn't allow outgoing connections on 22 to some hosts, but if I ssh to a trusted host first, I can ssh into my home computer from there, and X packets are forwarded merrily. You can try to set $DISPLAYs on all these machines (what if Box L2 doesn't have an X environment at all?), or use ssh and save yourself a lot of time.
Box L2 must have unix/linux(like)-enviroment n sshd running for the scene, but there is no requirement that that X must be started on L2 if u wonna tunnel through L2 to L3/L4... That only apply when say u want ur x-client from L3/L4.. to pop out on the screen of L2-box (like to annoy one working on that L2-screen). But for tunneling purpose, u don't need X-environmen running.

If u don't want X-client to pop out on L2 u don't need to set the DISPLAY variable on L3/L4.. at all. Just tunnel further to L3/L4../Lx. Then at Lx u can set DISPLAY to the display of L1 for comfortability. Then u can pop out X-clients to L1. If u like to give the option on each X-client command, then u don't need to set the variable DISPLAY. Just type: xterm -display L1-host:0, netscape -display L1-host:0 oh yeah, I forgeted: xeyes -display L1-host:0

 
Old 09-16-2003, 04:23 AM   #12
kuyalfinator
Member
 
Registered: Jul 2003
Location: Los Angeles
Distribution: RedHat8 2.4.18-14 RedHat9 2.4.20-8 FreeBSD 5.2.1 Ubuntu 10_4 Mandrake 2.4.21-0.13mdk
Posts: 118

Rep: Reputation: 16
Ok, this is what I understand so far from this thread.

remote_PC <-> local_PC

This is assuming the form of communication '<->' between machines is either through a LAN or WAN with 'high bandwidth' So, the following communications are possible for graphical or textmode log in.

example:
windows <-> windows
(OS range from 95 through XP)

linux <-> linux or unix <-> unix
(assuming both machines have identical Linux distros)

This is where it gets really complicated.

windows <-> linux
linux <-> unix
windows <-> unix

To have the different operating systems to see each other on a LAN or WAN and still be able to log in remotely. So, is it possible with the pre-packaged on Linux distros to have the different OS's to communicate? How much time and effort is going to be placed in this little bit of exploring? How much room would someone need?

I am currently working with Redhat, Mandrake, Win98, Win2K, and WinXP. I still need to place the LAN for the boxes to communicate via network. Then comes the fun part of configuring them all to 'see' each other. I have read post of users having their own local network at home. So, any advice? Should I try to get operating systems to see each other?
 
  


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 log? IchBin Linux - Newbie 9 08-25-2010 03:50 AM
SSH password less log-in provo1234 Linux - Networking 4 12-30-2004 06:07 PM
ssh won't log root in m2azer Linux - General 9 12-25-2004 11:37 PM
ssh cant log on!! e1000 Linux - Networking 4 02-16-2004 01:59 PM
SSH Log Crashed_Again Linux - Security 4 01-25-2003 09:56 AM

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

All times are GMT -5. The time now is 10:35 PM.

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