Special character's file or folder not displayed in ssh

Status
Not open for further replies.

huberte

Explorer
Joined
Sep 20, 2011
Messages
87
[Fixed]Special character's file or folder not displayed in ssh

Hi,

I have a lot of files with é à è. they are right on share, but not if I brwose them via ssh, sftp (é = é)

How can I fix this ?

Thanks
 

bollar

Patron
Joined
Oct 28, 2012
Messages
411
I'm sure the problem has to do with the locale settings either on your server, or on your client. Look at this discussion -- maybe it will give you some ideas: Foreign characters won't display in SSH
 

huberte

Explorer
Joined
Sep 20, 2011
Messages
87
Thanks, just red that before posting :) , is it safe to do that on freenas ?

uh ?

Is this normal :

Code:
[root@freenas] ~# locale
LANG=
LC_CTYPE="C"
LC_COLLATE="C"
LC_TIME="C"
LC_NUMERIC="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_ALL=
 

bollar

Patron
Joined
Oct 28, 2012
Messages
411
I have no idea what's normal, but mine are all set to UTF-8:


admin@storage:~# locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_ALL=

I don't know enough about this topic to even determine if the changes need to be made on FreeNAS, or on your client.
 

huberte

Explorer
Joined
Sep 20, 2011
Messages
87
Thanks :),

I think it comes from freenas, but I don't know how to fix this :!
 

huberte

Explorer
Joined
Sep 20, 2011
Messages
87
Did the upgrade with a fresh brand new usb stick, auto import my pool

here it is :

Code:
[root@freenas] ~# locale
LANG=
LC_CTYPE="C"
LC_COLLATE="C"
LC_TIME="C"
LC_NUMERIC="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_ALL=



why ?
 

huberte

Explorer
Joined
Sep 20, 2011
Messages
87
Checked here

http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/using-localization.html

24.3.4 Setting Locale

Usually it is sufficient to export the value of the locale name as LANG in the login shell. This could be done in the user's ~/.login_conf file or in the startup file of the user's shell (~/.profile, ~/.bashrc, ~/.cshrc). There is no need to set the locale subsets such as LC_CTYPE, LC_CTIME. Please refer to language-specific FreeBSD documentation for more information.

You should set the following two environment variables in your configuration files:

LANG for POSIX® setlocale(3) family functions

MM_CHARSET for applications' MIME character set

This includes the user shell configuration, the specific application configuration, and the X11 configuration.

But dunno how to set the lang parameter, should it be not automatic ?
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
How would you detect the locale to set it automatically? Alot of FreeNAS machines aren't even connected to the internet.
 

huberte

Explorer
Joined
Sep 20, 2011
Messages
87
With settings? My FreeNAS is connected!

How can I fix this?
 

bollar

Patron
Joined
Oct 28, 2012
Messages
411

huberte

Explorer
Joined
Sep 20, 2011
Messages
87
Is it not a bug from freenas ? Are my locale normal for a new installation ?
 

bollar

Patron
Joined
Oct 28, 2012
Messages
411

huberte

Explorer
Joined
Sep 20, 2011
Messages
87
Did add

3 lines on the bottom of this in etc/longin.conf

Code:
default:\
	:passwd_format=md5:\
	:copyright=/etc/COPYRIGHT:\
	:welcome=/etc/motd:\
	:setenv=MAIL=/var/mail/$,BLOCKSIZE=K,FTP_PASSIVE_MODE=YES:\
	:path=/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin ~/bin:\
	:nologin=/var/run/nologin:\
	:cputime=unlimited:\
	:datasize=unlimited:\
	:stacksize=unlimited:\
	:memorylocked=unlimited:\
	:memoryuse=unlimited:\
	:filesize=unlimited:\
	:coredumpsize=unlimited:\
	:openfiles=unlimited:\
	:maxproc=unlimited:\
	:sbsize=unlimited:\
	:vmemoryuse=unlimited:\
	:swapuse=unlimited:\
	:pseudoterminals=unlimited:\
	:priority=0:\
	:ignoretime@:\
	:umask=022:
	:umask=022:\
	:charset=UTF-8:\
	:lang=fr_FR.UTF-8:


Can't launch this :

Code:
[root@freenas] /# sudo cap_mkdb /etc/login.conf
Sorry, user root is not allowed to execute '/usr/bin/cap_mkdb /etc/login.conf' as root on freenas.local.
 

aidasan

Explorer
Joined
Aug 9, 2011
Messages
67
Salut,

If I understand the website juste up of your post :
Code:
blee@eclipse ~ $ diff -u /usr/src/etc/login.conf /etc/login.conf
--- /usr/src/etc/login.conf     2011-03-10 13:48:59.000000000 -0800
+++ /etc/login.conf     2011-05-08 16:44:01.000000000 -0700
@@ -26,7 +26,7 @@
        :passwd_format=md5:\
        :copyright=/etc/COPYRIGHT:\
        :welcome=/etc/motd:\
-       :setenv=MAIL=/var/mail/$,BLOCKSIZE=K,FTP_PASSIVE_MODE=YES:\
+       :setenv=MAIL=/var/mail/$,BLOCKSIZE=K,FTP_PASSIVE_MODE=YES,LC_COLLATE=C:\
        :path=/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin ~/bin:\
        :nologin=/var/run/nologin:\
        :cputime=unlimited:\
@@ -44,7 +44,9 @@
        :pseudoterminals=unlimited:\
        :priority=0:\
        :ignoretime@:\
-       :umask=022:
+       :umask=022:\
+       :charset=UTF-8:\
+       :lang=en_US.UTF-8:
 
 
 #


You should have :
Code:
default:\
	:passwd_format=md5:\
	:copyright=/etc/COPYRIGHT:\
	:welcome=/etc/motd:\
	:setenv=MAIL=/var/mail/$,BLOCKSIZE=K,FTP_PASSIVE_MODE=YES,LC_COLLATE=C:\
	:path=/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin ~/bin:\
	:nologin=/var/run/nologin:\
	:cputime=unlimited:\
	:datasize=unlimited:\
	:stacksize=unlimited:\
	:memorylocked=unlimited:\
	:memoryuse=unlimited:\
	:filesize=unlimited:\
	:coredumpsize=unlimited:\
	:openfiles=unlimited:\
	:maxproc=unlimited:\
	:sbsize=unlimited:\
	:vmemoryuse=unlimited:\
	:swapuse=unlimited:\
	:pseudoterminals=unlimited:\
	:priority=0:\
	:ignoretime@:\
	:umask=022:\
	:charset=UTF-8:\
	:lang=fr_FR.UTF-8:


And for the command sudo is used to execute a command as root on a user side.
But you already are with root.
Try cap_mkdb /etc/login.conf
 

huberte

Explorer
Joined
Sep 20, 2011
Messages
87
I did that (thanks :) )

Reboot


Changes ( and login.conf is back to the old one) :

Code:
[root@freenas ~]# locale                                                        
LANG=en_US.UTF-8                                                                
LC_CTYPE="en_US.UTF-8"                                                          
LC_COLLATE="en_US.UTF-8"                                                        
LC_TIME="en_US.UTF-8"                                                           
LC_NUMERIC="en_US.UTF-8"                                                        
LC_MONETARY="en_US.UTF-8"                                                       
LC_MESSAGES="en_US.UTF-8"                                                       
LC_ALL=     


why ?

But am I the only one who find it strange that freenas does not handle special character properly, without hacking the conf file ?
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Honestly, I don't think you CAN fix it. I gave up after only about 30 mins of searching last month when I had an issue that I thought was related to the locale being wrong. If someone has a clue I'd be more than willing to be a guinea pig and give it a try on my test bench FreeNAS system.
 

William Grzybowski

Wizard
iXsystems
Joined
May 27, 2011
Messages
1,754
Honestly, I don't think you CAN fix it. I gave up after only about 30 mins of searching last month when I had an issue that I thought was related to the locale being wrong. If someone has a clue I'd be more than willing to be a guinea pig and give it a try on my test bench FreeNAS system.

Code:
# ssh root@freenasdev
[root@freenas] ~# setenv LC_ALL en_US.UTF-8
[root@freenas] ~# locale
LANG=
LC_CTYPE="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_ALL=en_US.UTF-8
[root@freenas] ~# ã á í ú ó ñ ü ä


The thing is, your client/terminal has to support unicode/utf8 as well. I use rxvt-unicode (urxvt) or "xterm -en UTF-8".
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Holy smokes William! I changed it like you just showed not thinking that the terminal app (putty in my case) has to have UTF-8 set. I set UTF-8 and now it works! Now to figure out how to set that permanently....
 

huberte

Explorer
Joined
Sep 20, 2011
Messages
87
OMG !

It's not freenas fault :o

It's only putty/ftp software fault, like bollar said.

We just have to set to utf8 because it seems "automatic" does not work
 
Status
Not open for further replies.
Top