Special character's file or folder not displayed in ssh

Status
Not open for further replies.

babaroga

Explorer
Joined
Jul 22, 2012
Messages
50
Just to recap to all of this. Below are steps to change locale permanently, or at least until next upgrade.

Login as "root"

Code:
mount -uw /
vi /etc/login.conf


Add in "default" section of "login.conf" file, below ":umask=022:" line, as discussed in above threads.
Also, make sure that you add "\" at the end of "umask" line, after ":"

Code:
:charset=UTF-8:\
:lang=en_GB.UTF-8:


Save the file, and get back to the shell prompt.
Run following commands below, one after each other.

Code:
cap_mkdb /etc/login.conf
cp /etc/login.conf.db /conf/base/etc
cp /etc/login.conf /conf/base/etc
mount -ur /


Bear in mind that it can take 10+ minutes to run last mount command, so be patient.

Log out, and log back in, and there it is new locale set. If you do not know the parameter for ":lang", you can run "locale -a" at the shell and get the list of all available options.

Regards
 

Gavin

Dabbler
Joined
Aug 8, 2013
Messages
37
Will this survive a FreeNAS upgrade or will we have to redo the changes every time?
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
You will have to redo it every time. :(
 

xaibex

Patron
Joined
Mar 19, 2013
Messages
340
You have to Add
Code:
AcceptEnv LANG LC_*

to Additional Options at Services > SSH > Settings

then the locale is set properly if you connect and your ssh client does

Code:
 SendEnv LANG LC_*


Bildschirmfoto 2014-05-23 um 22.31.30.png
 

Phlogi

Dabbler
Joined
Apr 2, 2014
Messages
33
Anyone opened a bug report for the login settings? I think this should be set by default.
 

babaroga

Explorer
Joined
Jul 22, 2012
Messages
50
You have to Add
Code:
AcceptEnv LANG LC_*

to Additional Options at Services > SSH > Settings

then the locale is set properly if you connect and your ssh client does

Code:
 SendEnv LANG LC_*


View attachment 4283


Thank you for this add on. I do agree with this in case you want to send local time zone and locale of your client. However, in my case, my servers are set to GB time zone and locale, and I now live in Switzerland. I do not want to have German character set nor local CET if I login to server. I believe that we can add this to be "an optional step" on the top of original guide.

PS
And yes, it would be nice for us to be able to set up upgrade suvirvable "locale" through GUI
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526

Muddro

Explorer
Joined
Oct 6, 2014
Messages
59
So I had an issue today where this stopped me from being able to log in through SSH. After some troubleshooting, figured out it was the additional options because the locale had reverted to the default rather than the UTF. I think this must have occurred after a reboot. Is that typical? From what you all put, it seems it should only do so after an upgrade.
 

babaroga

Explorer
Joined
Jul 22, 2012
Messages
50
Hi Muddro, you have to apply this after every upgrade of the FreeNas. I still have to check on those new incremental updates in 9.3 if they blew this setting.

UPDATE 18/12/2014: Done incremental updates last night and my locale is still on UTF-8...result
 
Last edited:

Michael173

Cadet
Joined
Jan 9, 2015
Messages
4
Hello to all, I just followed the steps explained above to be able to use Chinese file names on our FreeNAS box. I don't know much about localization unfortunately and may be totally wrong on this - but I was expecting to be able to read Chines files names now when connecting over SSH. Unfortunately it seems not to work:

File on Local Disk of our MacBook:

-rw-rw-r--@ 1 yannie staff 37195 5 Jun 2014 地址.docx

Same file copied to NAS using a CIFS share and viewed on the NAS box via SSH:

-rw------- 1 yannie staff 37195 Jun 5 2014 ??????.docx

The locale seems not to be set in the SSH session though - at least the command locale shows the following:

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


My /etc/login.conf still contains the entries,

:charset=UTF-8:\
:lang=en_GB.UTF-8:


I repeated the steps above twice and even rebooted the machine. Any hint what I could miss?
I am using build FreeNAS-9.3-STABLE-201412090314. The Mac Terminal window I use for ssh is set to UTF-8, the local ssh client config does not contain any language specific settings.

Thanks for your help!
Michael
 

James S

Explorer
Joined
Apr 14, 2014
Messages
91
babaroga thanks for the guide on setting the language. My problem sounds similar to [URL='https://forums.freenas.org/index.php?members/michael173.46267/']Michael173 - I'm writing a backup to the FreeNAS box that includes many Chinese file names. When following the guides above the result was the same as [URL='https://forums.freenas.org/index.php?members/michael173.46267/']Michael173 i.e., the Chinese words were scrambled.[/URL][/URL]
I'm using SFTP for backup (with keys) pretty much as per the Freenas 9.2 guide and a backup program. The result is screwed up Chinese words.
I see there is a .login_conf for each user. FreeBSD seems to suggest basic parameters (such as locale) can be set here, in a user's home directory. Can I set a specific locale for a particular user here - i.e., what is the relationship with the login.conf that Baboroga is setting? I guess if we can set the locale in the user's home then it should survive upgrades since it is on the data part of the storage?
 
Status
Not open for further replies.
Top