How to set locale for non-interactive shells?


Recommended Posts

I need this to say en_US.UTF-8:

 

$ ssh root@tower locale
LANG=
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=

 

I can do this by adding "AcceptEnv LANG LC_*" into /etc/ssh/sshd_config and then doing "/etc/rc.d/rc.sshd restart". But I'm wondering if there's a better way, or if I should make a feature request for the next version of unraid.

 

Link to comment

Copy /etc/ssh/sshd_config to the flash drive and edit the copy as desired. Add a line in the go fie that copies the edited version from the flash to "/etc/ssh/sshd_config".

 

cp /boot/custom/sshd_config /etc/ssh/sshd_config

 

Or, if "AcceptEnv LANG LC_*" just needs to be added a the end of the file you can put this line in the go file:

 

echo "AcceptEnv LANG LC_*" >> /etc/ssh/sshd_config

 

 

Make a feature request.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.