# SSH login lanuage error

**URL:** https://dietpi.com/forum/t/ssh-login-lanuage-error/1640
**Category:** Troubleshooting
**Created:** [16 November 2017 19:37 UTC](https://dietpi.com/forum/t/ssh-login-lanuage-error/1640 "2017-11-16T19:37:42Z")
**Posts on this page:** 16
**Page:** 1

<div class="post-metadata">

### Author: ![Gord\_W](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/g/439d5e/32.png) [@Gord\_W](https://dietpi.com/forum/u/Gord_W)
#### Post date: [16 November 2017 19:37 UTC](https://dietpi.com/forum/t/ssh-login-lanuage-error/1640/1 "2017-11-16T19:37:42Z")

</div>

Hi,

Using NanoPi Neo with fresh install of current download version (DietPi\_v145\_NanoPiNEO-armv7-(Jessie)) which has been auto updated to current version.

No software installed. SSH into device using ethernet.

Not much changed in dietpi-config - Canadian English, time zone, LEDs - and I don’t think much else.  
  
  
gordon@gordon-linux ~ $ ssh [root@192.168.1.27](mailto:root@192.168.1.27)  
[root@192.168.1.27](mailto:root@192.168.1.27)’s password:  
-bash: export: `#LANG=en\_GB.UTF-8’: not a valid identifier

[3;J  
───────────────────────────────────────  
DietPi | 14:31 | Thu 11/16/17  
───────────────────────────────────────  
V158 | NanoPi Neo (armv7l)  
───────────────────────────────────────  
IP Address | 192.168.1.27  
───────────────────────────────────────

There are some funny characters in the line above the DietPi time - date line too.

Regards,  
Gordon Williams

---

<div class="post-metadata">

### Author: ![Fourdee](https://dietpi.com/forum/user_avatar/dietpi.com/fourdee/32/11_2.png) [@Fourdee](https://dietpi.com/forum/u/Fourdee)
#### Post date: [17 November 2017 19:48 UTC](https://dietpi.com/forum/t/ssh-login-lanuage-error/1640/2 "2017-11-17T19:48:00Z")

</div>

> [@Gord\_W](#):
>
> Hi,
> 
> Using NanoPi Neo with fresh install of current download version (DietPi\_v145\_NanoPiNEO-armv7-(Jessie)) which has been auto updated to current version.
> 
> No software installed. SSH into device using ethernet.
> 
> Not much changed in dietpi-config - Canadian English, time zone, LEDs - and I don’t think much else.  
>   
>   
> gordon@gordon-linux ~ $ ssh [root@192.168.1.27](mailto:root@192.168.1.27)  
> [root@192.168.1.27](mailto:root@192.168.1.27)’s password:  
> -bash: export: `#LANG=en\_GB.UTF-8’: not a valid identifier
> 
> [3;J  
> ───────────────────────────────────────  
> DietPi | 14:31 | Thu 11/16/17  
> ───────────────────────────────────────  
> V158 | NanoPi Neo (armv7l)  
> ───────────────────────────────────────  
> IP Address | 192.168.1.27  
> ───────────────────────────────────────
> 
> There are some funny characters in the line above the DietPi time - date line too.
> 
> Regards,  
> Gordon Williams

Hi Gordon,

Please ensure en\_GB.UTF-8 is installed on the system. Its required by DietPi to ensure all scripts scrape correctly, you can select another default if needed, but en\_GB.UTF-8 must be installed.

---

<div class="post-metadata">

### Author: ![Gord\_W](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/g/439d5e/32.png) [@Gord\_W](https://dietpi.com/forum/u/Gord_W)
#### Post date: [19 November 2017 15:47 UTC](https://dietpi.com/forum/t/ssh-login-lanuage-error/1640/3 "2017-11-19T15:47:37Z")

</div>

I didn’t uninstall en\_GB, just added Canadian English. I will go back and do a fresh install from the start and see if I can repeat the problem.

From the error message, it looked like LANG=en\_GB.UTF-8 was commented out.

Gordon

---

<div class="post-metadata">

### Author: ![Fourdee](https://dietpi.com/forum/user_avatar/dietpi.com/fourdee/32/11_2.png) [@Fourdee](https://dietpi.com/forum/u/Fourdee)
#### Post date: [19 November 2017 16:10 UTC](https://dietpi.com/forum/t/ssh-login-lanuage-error/1640/4 "2017-11-19T16:10:04Z")

</div>

> [@Gord\_W](#):
>
> I didn’t uninstall en\_GB, just added Canadian English. I will go back and do a fresh install from the start and see if I can repeat the problem.
> 
> From the error message, it looked like LANG=en\_GB.UTF-8 was commented out.
> 
> Gordon

Hi Gordon,

Yep, seen the comment, which is strange as the banner script is coded as below:  
[https://github.com/Fourdee/DietPi/blob/master/dietpi/dietpi-banner#L21](https://github.com/Fourdee/DietPi/blob/master/dietpi/dietpi-banner#L21)

If it happens again, please check which of the following scripts causes the “export” error:

```plaintext
/DietPi/dietpi/login
/DietPi/dietpi/dietpi-banner

```

---

<div class="post-metadata">

### Author: ![Gord\_W](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/g/439d5e/32.png) [@Gord\_W](https://dietpi.com/forum/u/Gord_W)
#### Post date: [19 November 2017 17:50 UTC](https://dietpi.com/forum/t/ssh-login-lanuage-error/1640/5 "2017-11-19T17:50:59Z")

</div>

Now doing a fresh install. During the first run right after after ssh login I get the same funny characters as seen below.  
Will check to see what else happens.  
Gordon

DietPi-Set\_Hardware  
─────────────────────────────────────────────────────  
Mode: preferipversion (auto)  
Please wait…

[Ok] preferipversion auto | Completed

[3;J  
───────────────────────────────────────  
DietPi | 17:45 | Sun 19/11/17  
───────────────────────────────────────  
V144 | NanoPi Neo (armv7l)  
───────────────────────────────────────  
IP Address | 192.168.1.10  
───────────────────────────────────────

Welcome to DietPi-Software

Edit: by funny characters I mean [3;J  
before the [ is a square box with very small printing in it.

---

<div class="post-metadata">

### Author: ![Gord\_W](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/g/439d5e/32.png) [@Gord\_W](https://dietpi.com/forum/u/Gord_W)
#### Post date: [19 November 2017 21:13 UTC](https://dietpi.com/forum/t/ssh-login-lanuage-error/1640/6 "2017-11-19T21:13:17Z")

</div>

With no locale or language change when I log on I get

gordon@gordon-linux ~ $ ssh [root@192.168.1.10](mailto:root@192.168.1.10)  
[root@192.168.1.10](mailto:root@192.168.1.10)’s password:  
[3;J

(same funny characters written to screen on line below PW.)

Next I will change locale and language.

---

<div class="post-metadata">

### Author: ![Gord\_W](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/g/439d5e/32.png) [@Gord\_W](https://dietpi.com/forum/u/Gord_W)
#### Post date: [19 November 2017 21:22 UTC](https://dietpi.com/forum/t/ssh-login-lanuage-error/1640/7 "2017-11-19T21:22:10Z")

</div>

language changed

Generating locales (this might take a while)…  
en\_CA.UTF-8… done  
en\_GB.UTF-8… done  
Generation complete.  
[3;J

I guess the box and [3;J are some sort of messed up screen control characters??

Now rebooting …  
SHH in

Yes! got it again!

Connection to 192.168.1.10 closed by remote host.  
Connection to 192.168.1.10 closed.  
gordon@gordon-linux ~ $ ssh [root@192.168.1.10](mailto:root@192.168.1.10)  
[root@192.168.1.10](mailto:root@192.168.1.10)’s password:  
-bash: export: `#LANG=en\_GB.UTF-8’: not a valid identifier  
[3;J

Now for the files that you asked for …

---

<div class="post-metadata">

### Author: ![Gord\_W](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/g/439d5e/32.png) [@Gord\_W](https://dietpi.com/forum/u/Gord_W)
#### Post date: [19 November 2017 21:44 UTC](https://dietpi.com/forum/t/ssh-login-lanuage-error/1640/8 "2017-11-19T21:44:06Z")

</div>

The only place that I can see LANG in /DietPi/dietpi/login  
#Force en\_GB Locale for whole script. Prevents incorrect parsing with non-english locales.  
LANG=en\_GB.UTF-8  
same for /DietPi/dietpi/dietpi-banner  
#Force en\_GB Locale for whole script. Prevents incorrect parsing with non-english locales.  
LANG=en\_GB.UTF-8

The scripts are kind of long to post here and I have already made lots of posts detailing what I have done so that you can hopefully repeat it.  
I can send them to you separately.

thanks,  
Gordon Williams

---

<div class="post-metadata">

### Author: ![Gord\_W](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/g/439d5e/32.png) [@Gord\_W](https://dietpi.com/forum/u/Gord_W)
#### Post date: [19 November 2017 21:48 UTC](https://dietpi.com/forum/t/ssh-login-lanuage-error/1640/9 "2017-11-19T21:48:01Z")

</div>

Hmm,  
One other thing that may or may not be of interest to you.

root@DietPi:~# locale  
LANG=  
LANGUAGE=  
LC\_CTYPE=“POSIX”  
LC\_NUMERIC=“POSIX”  
LC\_TIME=“POSIX”  
LC\_COLLATE=“POSIX”  
LC\_MONETARY=“POSIX”  
LC\_MESSAGES=“POSIX”  
LC\_PAPER=“POSIX”  
LC\_NAME=“POSIX”  
LC\_ADDRESS=“POSIX”  
LC\_TELEPHONE=“POSIX”  
LC\_MEASUREMENT=“POSIX”  
LC\_IDENTIFICATION=“POSIX”  
LC\_ALL=

That is different than my personal computer.

Gordon

---

<div class="post-metadata">

### Author: ![Fourdee](https://dietpi.com/forum/user_avatar/dietpi.com/fourdee/32/11_2.png) [@Fourdee](https://dietpi.com/forum/u/Fourdee)
#### Post date: [20 November 2017 17:17 UTC](https://dietpi.com/forum/t/ssh-login-lanuage-error/1640/10 "2017-11-20T17:17:37Z")

</div>

> [@Gord\_W](#):
>
> Hmm,  
> One other thing that may or may not be of interest to you.
> 
> root@DietPi:~# locale  
> LANG=  
> LANGUAGE=  
> LC\_CTYPE=“POSIX”  
> LC\_NUMERIC=“POSIX”  
> LC\_TIME=“POSIX”  
> LC\_COLLATE=“POSIX”  
> LC\_MONETARY=“POSIX”  
> LC\_MESSAGES=“POSIX”  
> LC\_PAPER=“POSIX”  
> LC\_NAME=“POSIX”  
> LC\_ADDRESS=“POSIX”  
> LC\_TELEPHONE=“POSIX”  
> LC\_MEASUREMENT=“POSIX”  
> LC\_IDENTIFICATION=“POSIX”  
> LC\_ALL=
> 
> That is different than my personal computer.
> 
> Gordon

Which SSH client are you running? Seems to be running in POSIX compatibility mode.

---

<div class="post-metadata">

### Author: ![Fourdee](https://dietpi.com/forum/user_avatar/dietpi.com/fourdee/32/11_2.png) [@Fourdee](https://dietpi.com/forum/u/Fourdee)
#### Post date: [20 November 2017 17:21 UTC](https://dietpi.com/forum/t/ssh-login-lanuage-error/1640/11 "2017-11-20T17:21:36Z")

</div>

Gordon,

Seems related to SSH client, please see below:  
[https://serverfault.com/questions/792252/posix-locale-when-i-use-ssh-with-a-command-line](https://serverfault.com/questions/792252/posix-locale-when-i-use-ssh-with-a-command-line)

---

<div class="post-metadata">

### Author: ![Gord\_W](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/g/439d5e/32.png) [@Gord\_W](https://dietpi.com/forum/u/Gord_W)
#### Post date: [20 November 2017 17:35 UTC](https://dietpi.com/forum/t/ssh-login-lanuage-error/1640/12 "2017-11-20T17:35:06Z")

</div>

I don’t see why the ssh client on my desktop would change the output of the dietpi locale command.  
It is the same as far as I know that I have been using for the last few years in Linux Mint 17.x

gordon@gordon-linux ~ $ ssh -V  
OpenSSH\_6.6.1p1 Ubuntu-2ubuntu2.8, OpenSSL 1.0.1f 6 Jan 2014

Is the output that I’m showing for dietpi what you are expecting for a Nanopi Neo with everything set to POSIX, No Language? I expected to see either en\_CA or en\_GB as these are the languages that are set on the dietpi.

Were you able to find the source file that created the error?  
  
  
Gordon

---

<div class="post-metadata">

### Author: ![Gord\_W](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/g/439d5e/32.png) [@Gord\_W](https://dietpi.com/forum/u/Gord_W)
#### Post date: [20 November 2017 17:46 UTC](https://dietpi.com/forum/t/ssh-login-lanuage-error/1640/13 "2017-11-20T17:46:36Z")

</div>

> [@Fourdee](#):
>
> Gordon,
> 
> Seems related to SSH client, please see below:  
> [linux - POSIX locale when I use SSH with a command line - Server Fault](https://serverfault.com/questions/792252/posix-locale-when-i-use-ssh-with-a-command-line)

Hmmm… Aren’t I using the second of the two examples? E.G. the normal ssh method? That gives what should be correct output.

Edit:  
OK, found how to test my shell  
gordon@gordon-linux ~ $ echo $SHELL  
/bin/bash  
gordon@gordon-linux ~ $ echo $0  
bash

I’m using the bash shell on my desktop.

Gordon

Edit2:  
Just in case I’m completely out to lunch and I’m miss-understanding you.  
root@DietPi:~# echo $0  
bash  
root@DietPi:~# echo $SHELL  
/bin/bash  
The dietpi shell is also bash.

---

<div class="post-metadata">

### Author: ![Gord\_W](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/g/439d5e/32.png) [@Gord\_W](https://dietpi.com/forum/u/Gord_W)
#### Post date: [20 November 2017 20:40 UTC](https://dietpi.com/forum/t/ssh-login-lanuage-error/1640/14 "2017-11-20T20:40:06Z")

</div>

A couple of more data points for you to consider:

I’ve tried 2 other computers, one linux and one windows with putty and both give me the -bash: export: `#LANG=en\_GB.UTF-8’: not a valid identifier

error just after the PW when sshing in.

Both show POSIX when locale command is used.

Trying to follow through your scripts is beyond my pay grade, so I’m not much help there. Sorry 🤔

This is what is installed on dietpi

root@DietPi:~# locale -a  
C  
C.UTF-8  
POSIX  
en\_CA.utf8  
en\_GB.utf8

Regards,  
Gordon

---

<div class="post-metadata">

### Author: ![Gord\_W](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/g/439d5e/32.png) [@Gord\_W](https://dietpi.com/forum/u/Gord_W)
#### Post date: [20 November 2017 21:19 UTC](https://dietpi.com/forum/t/ssh-login-lanuage-error/1640/15 "2017-11-20T21:19:20Z")

</div>

Dan,  
This may or may not be of help.

in  
root@DietPi:/etc# cat bash.bashrc

------------- snip -------------------------  
else  
printf “%s: command not found\n” “$1” \>&2  
return 127  
fi  
}  
fi  
if [[-f /etc/bash.bashrc.custom]]; then  
. /etc/bash.bashrc.custom  
fi  
export $(cat /etc/default/locale | grep LANG=)  
#DietPi Additions  
alias sudo=‘sudo ’ # [https://github.com/Fourdee/DietPi/issues/424](https://github.com/Fourdee/DietPi/issues/424)  
alias dietpi-process\_tool=’/DietPi/dietpi/dietpi-process\_tool’  
alias dietpi-letsencrypt=‘/DietPi/dietpi/dietpi-letsencrypt’  
----------------- snip --------------------------------------------------------------------------

1. 

note double brackets in  
if [[-f /etc/bash.bashrc.custom]]; then  
That section is new and wasn’t in an earlier version of dietpi that I was using.

1. export $(cat /etc/default/locale | grep LANG=)  
takes us to

# File generated by update-locale

LANGUAGE=en\_GB.UTF-8  
#LANG=en\_GB.UTF-8  
LC\_MESSAGES=en\_GB.UTF-8

You will note that the #LANG line is the line that is barfing during the login process.

What should I try?

Regards,  
Gordon

---

<div class="post-metadata">

### Author: ![Gord\_W](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/g/439d5e/32.png) [@Gord\_W](https://dietpi.com/forum/u/Gord_W)
#### Post date: [20 November 2017 22:09 UTC](https://dietpi.com/forum/t/ssh-login-lanuage-error/1640/16 "2017-11-20T22:09:33Z")

</div>

Dan,

I uncommented the  
#LANG=en\_GB.UTF-8  
above and rebooted

now locale shows

root@DietPi:~# locale  
LANG=en\_GB.UTF-8  
LANGUAGE=  
LC\_CTYPE=“en\_GB.UTF-8”  
LC\_NUMERIC=“en\_GB.UTF-8”  
LC\_TIME=“en\_GB.UTF-8”  
LC\_COLLATE=“en\_GB.UTF-8”  
LC\_MONETARY=“en\_GB.UTF-8”  
LC\_MESSAGES=“en\_GB.UTF-8”  
LC\_PAPER=“en\_GB.UTF-8”  
LC\_NAME=“en\_GB.UTF-8”  
LC\_ADDRESS=“en\_GB.UTF-8”  
LC\_TELEPHONE=“en\_GB.UTF-8”  
LC\_MEASUREMENT=“en\_GB.UTF-8”  
LC\_IDENTIFICATION=“en\_GB.UTF-8”  
LC\_ALL=

The characters in dietpi-software have been fixed too.

Running update-locale doesn’t comment the LANG out again:

root@DietPi:~# update-locale  
root@DietPi:~# cat /etc/default/locale

# File generated by update-locale

LANGUAGE=en\_GB.UTF-8  
LANG=en\_GB.UTF-8  
LC\_MESSAGES=en\_GB.UTF-8

So there is a bug somewhere either in the setup or the files that are downloaded as this happen twice on fresh installs.

Not sure why it is en\_GB rather than en\_CA which was installed. How do I get en\_CA ?

Gordon
