LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 03-21-2012, 12:30 PM   #1
linuxuser2k11
LQ Newbie
 
Registered: Mar 2012
Posts: 11

Rep: Reputation: Disabled
Help needed..Enabling SSH in Linux when connecting with Xming locally


Hi,

Need your input on this.Should I be starting ssh service in a RHEL 5.5 server to able to display GUI for applications I run on server?. Iam using Xming Windows Server locally from my Windows XP machine and iam connecting to the Linux server using Putty.

Thanks in advance
Alice
 
Old 03-21-2012, 03:02 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,972
Blog Entries: 11

Rep: Reputation: 876Reputation: 876Reputation: 876Reputation: 876Reputation: 876Reputation: 876Reputation: 876
Hi,

ssh would be a sensible way of redirecting output from the RHEL box to
your windows machine. So yes, starting the ssh service is essential.


Cheers,
Tink
 
Old 03-21-2012, 03:26 PM   #3
linuxuser2k11
LQ Newbie
 
Registered: Mar 2012
Posts: 11

Original Poster
Rep: Reputation: Disabled
Thanks

Iam trying to start the ssh service using /etc/init.d/sshd start. but when I debug it using sshd -d command i gives an error

Bind to port 22 on 0.0.0.0 failed: Address already in use.
Cannot bind any address.

I tried to enable SO_REUSEADDR option by disabling X11UseLocalHost but no good.

Let me know if you have any ideas on this.
 
Old 03-21-2012, 03:29 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,972
Blog Entries: 11

Rep: Reputation: 876Reputation: 876Reputation: 876Reputation: 876Reputation: 876Reputation: 876Reputation: 876
well ... is sshd already running?
pgrep -l sshd

If it's running, what does its configuration file look like?
cat /etc/ssh/sshd_config


Cheers,
Tink
 
Old 03-21-2012, 03:40 PM   #5
linuxuser2k11
LQ Newbie
 
Registered: Mar 2012
Posts: 11

Original Poster
Rep: Reputation: Disabled
I used the comamnd to check if its running and it listed two ports

3059 sshd
22838 sshd

but I thought sshd -d lists whether ssh started or not so does this indicate it is started?

and this how my sshd_config file looks


# $OpenBSD: sshd_config,v 1.65 2003/08/28 12:54:34 markus Exp $

# This is the sshd server system-wide configuration file. See
# sshd_config(5) for more information.

# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin

# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented. Uncommented options change a
# default value.

Port 22
Protocol 2,1
ListenAddress 0.0.0.0


# HostKey for protocol version 1
#HostKey /etc/ssh/ssh_host_key
# HostKeys for protocol version 2
#HostKey /etc/ssh/ssh_host_rsa_key
#HostKey /etc/ssh/ssh_host_dsa_key

# Lifetime and size of ephemeral version 1 server key
#KeyRegenerationInterval 1h
#ServerKeyBits 768

# Logging
#obsoletes QuietMode and FascistLogging
#SyslogFacility AUTH
#LogLevel INFO

# Authentication:

#LoginGraceTime 2m
#PermitRootLogin yes
#StrictModes yes

#RSAAuthentication yes
#PubkeyAuthentication yes
#AuthorizedKeysFile .ssh/authorized_keys

# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
#RhostsRSAAuthentication no
# similar for protocol version 2
#HostbasedAuthentication no
# Change to yes if you don't trust ~/.ssh/known_hosts for
# RhostsRSAAuthentication and HostbasedAuthentication
#IgnoreUserKnownHosts no
# Don't read the user's ~/.rhosts and ~/.shosts files
#IgnoreRhosts yes

# To disable tunneled clear text passwords, change to no here!
#PasswordAuthentication yes
#PermitEmptyPasswords no

# Change to no to disable s/key passwords
#ChallengeResponseAuthentication yes

# Kerberos options
#KerberosAuthentication no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes

# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCreds yes

# Set this to 'yes' to enable PAM authentication (via challenge-response)
# and session processing. Depending on your PAM configuration, this may
# bypass the setting of 'PasswordAuthentication'
#UsePAM yes

#AllowTcpForwarding yes
#GatewayPorts no
#X11Forwarding no
#X11DisplayOffset 10
X11UseLocalhost no
#PrintMotd yes
#PrintLastLog yes
#KeepAlive yes
#UseLogin no
#UsePrivilegeSeparation yes
#PermitUserEnvironment no
#Compression yes
#ClientAliveInterval 0
#ClientAliveCountMax 3
#UseDNS yes
#PidFile /var/run/sshd.pid
#MaxStartups 10

# no default banner path
#Banner /some/path

# override default of no subsystems
Subsystem sftp /usr/libexec/sftp-server
 
Old 03-21-2012, 03:49 PM   #6
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,972
Blog Entries: 11

Rep: Reputation: 876Reputation: 876Reputation: 876Reputation: 876Reputation: 876Reputation: 876Reputation: 876
It's certainly running, and the fact that there's two instances suggests that
someone is actually connected.

What you need to do to be able to use X11 remotely is to un-comnent
#X11Forwarding no
and change it to
X11Forwarding yes
(or copy the line, or manually add it, or whatever is considered best
practice in your organisation ...) and restart the service.

service sshd restart

Note that this will NOT kill existing connections (however, they will
not benefit from the config change).

Cheers,
Tink
 
Old 03-21-2012, 04:01 PM   #7
linuxuser2k11
LQ Newbie
 
Registered: Mar 2012
Posts: 11

Original Poster
Rep: Reputation: Disabled
Thanks

yepp did it but sshd -d command shows the error but i guess if the ssh is running I guess its fine.

The main reason i started looking at the ssh service is when i launch applications in Linux server it was giving this error

Loading of com.teamcenter.install.insweb.gui.TextBundle_en_US ... attempted.
Loading of com.teamcenter.install.insweb.gui.TextBundle succeeded.
Exception in thread "main" java.lang.InternalError: Can't connect to X11 window server using ':0.0' as the value of the DISPLAY variable.
at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
at sun.awt.X11GraphicsEnvironment.access$100(X11GraphicsEnvironment.java:52)
at sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:155)
at java.security.AccessController.doPrivileged(Native Method)
at sun.awt.X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:131)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:68)
at java.awt.Window.init(Window.java:379)
at java.awt.Window.<init>(Window.java:432)
at java.awt.Frame.<init>(Frame.java:403)
at javax.swing.JFrame.<init>(JFrame.java:207)
at com.teamcenter.install.common.gui.ChildFrame.<init>(ChildFrame.java:26)
at com.teamcenter.install.common.gui.OKCancelFrame.<init>(OKCancelFrame.java:58)
at com.teamcenter.install.insweb.gui.MsgWindow.<init>(MsgWindow.java:53)
at com.teamcenter.install.insweb.gui.MsgWindow.<init>(MsgWindow.java:45)
at com.teamcenter.install.insweb.gui.StatusWindow.<init>(StatusWindow.java:34)
at com.teamcenter.install.insweb.gui.StatusWindow._getSingleton(StatusWindow.java:82)
at com.teamcenter.install.insweb.gui.Insweb.main(Insweb.java:59)

and this started popping up after a server reboot. So I was not sure if some service needs to be started manually on my server to enable X11forwarding. But looks like after the changes to the sshd_config file it looks no good.
 
Old 03-21-2012, 04:14 PM   #8
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,972
Blog Entries: 11

Rep: Reputation: 876Reputation: 876Reputation: 876Reputation: 876Reputation: 876Reputation: 876Reputation: 876
Quote:
Originally Posted by linuxuser2k11 View Post
Thanks

yepp did it but sshd -d command shows the error but i guess if the ssh is running I guess its fine.
Which error?
 
Old 03-21-2012, 04:15 PM   #9
linuxuser2k11
LQ Newbie
 
Registered: Mar 2012
Posts: 11

Original Poster
Rep: Reputation: Disabled
Bind to port 22 on 0.0.0.0 failed: Address already in use.
Cannot bind any address.
 
Old 03-22-2012, 09:37 AM   #10
linuxuser2k11
LQ Newbie
 
Registered: Mar 2012
Posts: 11

Original Poster
Rep: Reputation: Disabled
any ideas..thanks
 
Old 03-22-2012, 12:21 PM   #11
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,972
Blog Entries: 11

Rep: Reputation: 876Reputation: 876Reputation: 876Reputation: 876Reputation: 876Reputation: 876Reputation: 876
Sorry, from the posts above I'm uncertain as to what the current issue might be?
 
Old 03-22-2012, 03:20 PM   #12
linuxuser2k11
LQ Newbie
 
Registered: Mar 2012
Posts: 11

Original Poster
Rep: Reputation: Disabled
Smile Fixed

i guess the solution lies in beginning some services and ensuring them they start.

1) As you know I had sshd process started through /etc/init.d/sshd start

2) Then start Xfs in the server -- /etc/init.d/xfs start

3) if you are getting a unix:/7100 error when typing startx

I commented the line FontPath= unix/:7100 in /root/xorg.conf.new (or if xfs fails start this was some fonts erver which was causing a problem too)

4)Now in my case its started setting DISPLAY variable to localhost:10.0

5) then all I had to do was in my local machine I opened a Cygwin bash shell then put in "export DISPLAY=localhost:10.0". Then when I launched my application it began to load through.

--The weird part was that In Cygwin bash shell I had to do that explicitly to launch it first time. But then I started up Xming next and I never used export command again and it automatically launched. i guess once its set up you don't need the export command again.

some other changes i made was I changed the user permission on .Xauthority file . Not sure if this also impacted it but I guess it was the Xfs service that made a difference.

hope it helps for someone for spent some long time on it.
 
Old 03-22-2012, 03:29 PM   #13
linuxuser2k11
LQ Newbie
 
Registered: Mar 2012
Posts: 11

Original Poster
Rep: Reputation: Disabled
Thanks for the help tinkster..!!!
 
  


Reply

Tags
linux, windows xp, xming


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
How to start Gnome GUI in Xming over SSH bozox Linux - General 6 03-21-2014 08:20 AM
SSH working locally but not remotely on Red Hat Enterprise Linux macd909 Red Hat 7 01-08-2012 08:00 PM
How can I ssh into Linux box and play music back to laptop locally? trox Linux - Networking 4 01-05-2011 04:11 AM
Setup stand-alone network printer to multiple Linux's without connecting locally bgoodr Linux - Networking 2 04-17-2010 11:32 AM
LXer: Blue GNU Wrong About Xming - Xming No Longer GPL LXer Syndicated Linux News 0 11-19-2007 05:41 AM


All times are GMT -5. The time now is 07:37 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration