LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 10-02-2007, 08:00 AM   #16
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,687

Original Poster
Rep: Reputation: 55

Quote:
Originally Posted by raskin View Post
I mean
Code:
 ssh -X satimis@192.168.0.10
strace -f -o leafpad.strace leafpad
Does it work and what does leafpad.strace contain?
Repeated steps on server. No complaint found.


On desktop
$ xhost + 127.0.0.110
Code:
127.0.0.1 being added to access control list
$ ssh -X satimis@192.168.0.10 strace -f -o leaf.strace leafpad
satimis@192.168.0.10's password:
Code:
(leafpad:7467): Gtk-WARNING **: Locale not supported by C library.
        Using the fallback 'C' locale.
This is locale problem, maybe of the perl script. I read many doc found on googling. But can't find my solution.


On running;
$ sudo /etc/init.d/httpd.vmware start
Code:
Starting httpd.vmware:
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = (unset),
        LANG = "en_HK.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
Similar warning popup

$ sudo aptitude install locales

my solve my problem. I haven't tried yet.


Previously I also suffered locale problem on this server. I tried to fix the problem, resulting in the server crashed finally. This is a fresh installation, not complete yet. Therefore I have to proceed with caution.


satimis
 
Old 10-02-2007, 08:04 AM   #17
raskin
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900

Rep: Reputation: 69
Locale problems should be ignored. If you wait a minute, does window appear?
 
Old 10-02-2007, 10:29 AM   #18
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,687

Original Poster
Rep: Reputation: 55
Quote:
Originally Posted by raskin View Post
Locale problems should be ignored. If you wait a minute, does window appear?
Just repeated following steps. This time ran rox, the file manager, instead of leafpad.


On server:-

$ echo $LC_ALL ; echo $LANG
Code:
en_HK.UTF-8
$ export LC_ALL=C; export LANG=C
No complaint

$ strace -f -o rox.strace rox
Code:
(rox:4987): Gtk-WARNING **: Could not find the icon 'mime-text:plain'. The 'hicolor' theme
was not found either, perhaps you need to install it.
You can get a copy from:
        http://icon-theme.freedesktop.org/releases
Rox started with above warning popup on console.


On desktop :-

$ xhost + 127.0.0.1
Code:
127.0.0.1 being added to access control list
$ ssh -X satimis@192.168.0.1 strace -f -o rox.strace rox
satimis@192.168.0.1's password
Code:
(process:4994): Gdk-Warning **: locale not supported by C library

(rox:4994): Gtk-Warning ** Locale not supported by C library.
         Using the fallback 'C' locale.

(rox:4994): Gtk-Warning ** cannot open display:
It waited for at least 3 minutes before the last line popup.


satimis
 
Old 10-02-2007, 12:51 PM   #19
raskin
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900

Rep: Reputation: 69
Do you have $DISPLAY set on your desktop?
 
Old 10-02-2007, 09:26 PM   #20
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,687

Original Poster
Rep: Reputation: 55
Quote:
Originally Posted by raskin View Post
Do you have $DISPLAY set on your desktop?
Could you please explain in more detail? On desktop which file I have to check and adjust it. TIA


satimis
 
Old 10-02-2007, 10:02 PM   #21
raskin
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900

Rep: Reputation: 69
When I ask about $DISPLAY, I mean $DISPLAY environment variable. It can be viewed by
Code:
 echo $DISPLAY
. I start to suspect that for some strange reason the $DISPLAY variable set by X on desktop is not inherited by shell you run ssh from.
 
Old 10-02-2007, 10:21 PM   #22
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,687

Original Poster
Rep: Reputation: 55
Quote:
Originally Posted by raskin View Post
When I ask about $DISPLAY, I mean $DISPLAY environment variable. It can be viewed by
Code:
 echo $DISPLAY
. I start to suspect that for some strange reason the $DISPLAY variable set by X on desktop is not inherited by shell you run ssh from.
On desktop

$ echo $DISPLAY
Code:
:0.0
same as on server
 
Old 10-03-2007, 02:12 PM   #23
raskin
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900

Rep: Reputation: 69
And on server through ssh?
 
Old 10-03-2007, 08:11 PM   #24
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,687

Original Poster
Rep: Reputation: 55
Quote:
Originally Posted by raskin View Post
And on server through ssh?
Yes, it works seamlessly with remote rox displayed locally.


Performed further 2 tests:-


1)
Test-1

a)
server to another desktop F7 on 192.168.0.12

$ ssh -Y satimis@192.168.0.12 nautilus

It worked w/o problem with remote nautilus displayed locally.


b)
desktop F7 to server

$ ssh -Y satimis@192.168.0.10 rox

with the same result unable to display remote rox locally. Server can be ssh-connected.



2)
Test-2

Installed localeconf on server.

$ cat /etc/environment
Code:
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
LANG="en_US.UTF-8"
### BEGIN DEBCONF SECTION FOR localeconf
# Do not edit within this region if you want your changes to be preserved
# by debconf.  Instead, make changes before the "### BEGIN DEBCONF SECTION
# FOR localeconf" line, and/or after the "### END DEBCONF SECTION FOR
# localeconf" line.
LANG=C
### END DEBCONF SECTION FOR localeconf
LANG=C added.


$ sudo /etc/init.d/httpd.vmware start
Code:
Starting httpd.vmware:
the problem on starting VMWare solved.


After rebooting the server and running;

$ sudo /etc/init.d/httpd.vmware start
Code:
Password:
Starting httpd.vmware:
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = (unset),
        LANG = "en_HK.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
VMWare failed to start.

I have to run;
$ export LC_ALL="C"
No complaint.

$ sudo /etc/init.d/httpd.vmware start
Code:
Starting httpd.vmware:
then it worked again. Where shall I check? TIA


satimis
 
Old 10-03-2007, 09:33 PM   #25
raskin
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900

Rep: Reputation: 69
"On server through SSH" - I meant, what is in $DISPLAY when you 'ssh -X' from client to server and check inside ssh session.
About VMWare - what is your goal? To defeat chaos or to have it running? In the latter I think that setting the environment variable in the beginning of the script will be enough (perl should work somehow, and script itself will not be able to tell the difference once variable is set)
 
Old 10-03-2007, 10:25 PM   #26
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,687

Original Poster
Rep: Reputation: 55
Quote:
Originally Posted by raskin View Post
"On server through SSH" - I meant, what is in $DISPLAY when you 'ssh -X' from client to server and check inside ssh session.
On server, repeat following steps:-

$ echo $LC_ALL ; echo $LANG
Code:

en_HK.UTF-8
$ export LC_ALL=C; export LANG=C
No complaint

$ echo $DISPLAY
Code:
:0.0
$ strace -f -o rox.strace rox
start rox window


On desktop:-

$ ssh -X satimis@192.168.0.10
server connected. "ls" displayed remote data locally

$ echo $DISPLAY
Code:
localhost:10:0
It displays different output compared with that run on server?


Quote:
About VMWare - what is your goal? To defeat chaos or to have it running? In the latter I think that setting the environment variable in the beginning of the script will be enough (perl should work somehow, and script itself will not be able to tell the difference once variable is set)
I'm building a virtual machine on this server. In the midway I needed to transfer some files from server to the desktop PC for storage and found the ssh problem. Before the server crashed (this is a new installation, not completed yet - 2nd round on building virtural machine), ssh worked both ways, with X forwarded. The only problem was same file-manager being needed for transferring files with drag-n-drop. That is the whole story.


$ perl -version
Code:
This is perl, v5.8.8 built for x86_64-linux-gnu-thread-multi

Copyright 1987-2006, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl".  If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.

satimis
 
Old 10-05-2007, 12:06 AM   #27
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,687

Original Poster
Rep: Reputation: 55
Cause of problem found

Hi raskin,


I found the cause of problem. It is the firewall "iptables" which stops X forwarding.

On server after running;
$ sudo iptables -F


On desktop;
$ ssh -X satimis@192.168.0.10 rox
Code:
satimis@192.168.0.10's password: 

(process:5282): Gdk-WARNING **: locale not supported by C library

(rox:5282): Gtk-WARNING **: Locale not supported by C library.
        Using the fallback 'C' locale.

(rox:5285): Gtk-WARNING **: Could not find the icon 'mime-text:plain'. The 'hicolor' theme
was not found either, perhaps you need to install it.
You can get a copy from:
        http://icon-theme.freedesktop.org/releases

(leafpad:5286): Gtk-WARNING **: Locale not supported by C library.
        Using the fallback 'C' locale.

(leafpad:5287): Gtk-WARNING **: Locale not supported by C library.
        Using the fallback 'C' locale.
remote rox displayed locally. Files can be evoked. I don't know why it displays a misleading warning there fooling around us.


Before the server crashed I ran another firewall script. I'm now running following scripts;
$ cat /etc/rc.local
Code:
#
# INPUT
#

# allow all incoming traffic from the management interface NIC
# as long as it is a part of an established connection
iptables -I INPUT 1 -j ACCEPT -d MGMT_NIC_IP -m state --state
RELATED,ESTABLISHED

# allow all ssh traffic to the management interface NIC
iptables -I INPUT 2 -j ACCEPT -p TCP -d MGMT_NIC_IP --destination-port 22

# allow all VMware MUI HTTP traffic to the management interface NIC
iptables -I INPUT 3 -j ACCEPT -p TCP -d MGMT_NIC_IP --destination-port 8222

# allow all VMware MUI HTTPS traffic to the management interface NIC
iptables -I INPUT 4 -j ACCEPT -p TCP -d MGMT_NIC_IP --destination-port 8333

# allow all VMware Authorization Daemon traffic to the management
interface NIC
iptables -I INPUT 5 -j ACCEPT -p TCP -d MGMT_NIC_IP --destination-port 902

# reject all other traffic to the management interface NIC
iptables -I INPUT 6 -j REJECT -d MGMT_NIC_IP --reject-with
icmp-port-unreachable


#
# OUTPUT
#

# allow all outgoing traffic from the management interface NIC
# if it is a part of an established connection
iptables -I OUTPUT 1 -j ACCEPT -s MGMT_NIC_IP -m state --state
RELATED,ESTABLISHED

# allow all DNS queries from the management interface NIC
iptables -I OUTPUT 2 -j ACCEPT -s MGMT_NIC_IP -p UDP --destination-port 53

# reject all other traffic from localhost
iptables -I OUTPUT 3 -j REJECT -s 127.0.0.1 --reject-with
icmp-port-unreachable

# reject all other traffic from the management interface NIC
iptables -I OUTPUT 4 -j REJECT -s MGMT_NIC_IP --reject-with
icmp-port-unreachable
MGMT_NIC_IP = server_IP


On server;

Restart iptables
$ sudo /etc/rc.local restart
No complaint

On desktop running
$ ssh -X satimis@server_IP rox
Code:
ssh: connect to host server_IP port 22: Connection refused
$ ssh -X server_IP
Code:
ssh: connect to host server_IP port 22: Connection refused
It did not work


Again on server
$ sudo nano /etc/ssh/sshd_config
adding "ListenAddress 192.168.0.11" (router IP)

$ cat /etc/ssh/sshd_config
Code:
....
Port 22
ListenAddress 192.168.0.10
ListenAddress 192.168.0.11
....
$ sudo /etc/init.d/ssh restart


Again on desktop
$ ssh -X satimis@server_IP rox
Code:
ssh: connect to host server_IP port 22: Connection refused
$ ssh -X server_IP
Code:
ssh: connect to host server_IP port 22: Connection refused
Problem still there. Any advice?

TIA


satimis
 
Old 10-05-2007, 12:27 AM   #28
raskin
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900

Rep: Reputation: 69
Well, the warnings were not misleading for me - I knew they have nothing to do with the problem. About iptables - did you check what rules take precedence in iptables, first specified or last specified? About VMWare - so does creating a shell script 'httpd.vmware' with contents
Code:
 export LC_ALL=C ; export LANG=c; perl httpd.vmware.perl
help?
 
Old 10-05-2007, 02:37 AM   #29
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,687

Original Poster
Rep: Reputation: 55
Quote:
Originally Posted by raskin View Post
About iptables - did you check what rules take precedence in iptables, first specified or last specified?
Nothing else. The content listed on my previous posting is the complete script on /etc/rc.local.

I created an executable file on /etc/network/if-up.d/iptables.start
and copid the complete script on the file. Each time on starting the network iptables started as well.


Quote:
About VMWare - so does creating a shell script 'httpd.vmware' with contents
Code:
 export LC_ALL=C ; export LANG=C; perl httpd.vmware.perl
help?
Your advice, with minor modification, then works. Thanks

$ sudo /etc/init.d/httpd.vmware start
Code:
Password:
Can't open perl script "httpd.vmware.perl": No such file or directory
Starting httpd.vmware:

After deleting "perl httpd.vmware.perl"
$ sudo /etc/init.d/httpd.vmware start
Code:
Password:
Starting httpd.vmware:

What are your trying to do with that phrase?


B.R.
satimis
 
Old 10-05-2007, 03:02 AM   #30
raskin
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900

Rep: Reputation: 69
I meant that you move old httpd.vmware perl script to httpd.vmware.perl
About precedence - yu issue multiple commands for every chain. Are sure about the order?
 
  


Reply


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
Running GUI in SSH Towlies Linux - Newbie 10 05-17-2007 05:23 PM
Do I need ssh running? reesee Linux - Security 7 01-02-2006 10:01 PM
problem in running ssh command skvasistha Linux - General 1 11-29-2004 06:12 AM
running ssh on redhat 8.0 sheek Linux - Newbie 2 07-22-2003 06:46 PM
Running X through SSH cdakin Linux - Newbie 0 04-23-2002 08:40 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 05:02 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