Sometimes, in some commands (the one I used was
you will notice ugly chars instead of graphical-box-chars. At the same
time some other tools (
mc for example) is displaying a valid box
chars. So, what was the problem?
The reason was not having
LANG variable set. In another words, locale
settings were not set. Typing
locale gave me everything set to
LANG was not set at all.
You can always override all settings with
export LC_ALL=en_US.utf8, as
LC_ALL was also unset. But as
LC_ALL serves as a override over all
other locale variables, I think we should avoid that.
Also, enough is to set
export LANG=en_US.utf8 and this solved the
problem. The question was: Why is this happening and is there a better
For more info, the best locale explanation are explained here
Finding the cause
I noticed that locale is valid as root user, but not as user. So I tried different solutions below.
The hint of valid solution was found in this here.
Force locale per user
We can always force
LANG setting from
appending something like
export LANG=en_US.UTF-8 to
This will work, but is not the expected solution.
Forward locale from client
On remote server, there has to be directive
sshd_config. On client, I have set
specified host and also set local environment
Remote connections are the reason
The real problem was
sshd_config, that I disabled for
security reasons. So to run PAM account and session checks but without
PAM authentication, then enable
UsePAM=yes but disable