• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login
Netgate Discussion Forum
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login

Pfsense localization connecting on console or via SSH

Scheduled Pinned Locked Moved General pfSense Questions
9 Posts 3 Posters 2.9k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F
    fog
    last edited by Jan 5, 2021, 3:35 PM

    Hello. This is my first (long) post.
    I have been a long time and satisfied pfsense user. I just migrated my pfsense appliance from a pc engines apu3 mb to a VM running on VMware esxi.
    Now, I'm more focused than before on interacting with pfsense via console or ssh. I've noticed that pfsense completely lacks localization support when it comes to using a shell on the console or via ssh.
    I am Italian and I use a macbook pro with an Italian keyboard to configure pfsense. To some this may seem like a sheer exercise in skill considering that pfsense is designed to be used via the web interface. In part it is so but I think that for someone the solution of my problems can be useful.
    These are the problems I have faced and solved (remember that I would like to troubleshoot both the shell on console and the shell via ssh).
    Step 1) Keyboard mapping.
    As pfsense doesn't suport the /etc/rc.conf file The only way I found to solve this problem was to install the "shellcmd" package and enter this command:

    /usr/sbin/kbdcontrol -l /usr/share/vt/keymaps/it.kbd.
    

    Users of other keyboard type can enter the appropriate setting.
    Point 2) Language localization.
    I've discovered that the files .profile and .tcshrc get owerwrited after each reboot so the way to set language localization (that is also the suggested metod by FreeBSD, see https://www.freebsd.org/doc/handbook/using-localization.html) was to create a .login_conf file in the home directory of root with the following content:

    me:\
            :charset=UTF-8:\
            :lang=en_US.UTF-8:
    

    and then execute:

    cap_mkdb .login_conf
    

    At this point the localization should work ... and instead nope!
    Why?
    Because the localization files in the pfsense distribution in each subdirectory of /usr/share/locale are completely missing. You need to copy the desired localization files (I dont know if the localization files get distributed as a package in FreeBSD) from an install DVD of FreBSD (attaching the ISO file as a DVD to the VM running pfsense or inserting the burned DVD in the physical machine in the DVD reader, if any, of the physica lmachine running pfsense) or from a running FreBSD machine (physical or virtual) trhough, for example, the scp command.
    In my case I've created a FreBSD VM on my mac with VirtualBox and then, via scp, copied the wanted localization files, in my case the files for US localization. In other words from the console of my FreeBSD VM machine i've executed the following command:

    scp /usr/share/locale/en_US.UTF-8/* root@<ipaddress-of-pfsense>:/usr/share/locale/en_US.UTF-8/
    

    Voilà! Now all my accented and special characters get correctly printed on the console and on the ssh terminal.
    I dont know if the modified settings get preserved across updates of pfsense.
    It would be useful if the pfsense distribution contain a minimal set of localization files and if the web GUI contain appropriate means to set the keyboard and the locale settings for who login from console or via ssh only only for the case (this is important) that secure passwords often must contain special charachetrs.

    Note:
    For users of the Terminal.app on Mac OS. Once you have set pfsense as described above, make be sure that in the preferences of the application the checkbox "Escape non-ASCII input with Control-V" in the "Advanced" section for the terminal type chosen is NOT checked.

    Regards
    Fabio

    K 1 Reply Last reply Jan 5, 2021, 5:14 PM Reply Quote 0
    • K
      kiokoman LAYER 8 @fog
      last edited by kiokoman Jan 5, 2021, 5:17 PM Jan 5, 2021, 5:14 PM

      @fog

      yup it would be nice, we have discussed it here
      https://forum.netgate.com/topic/148227/change-keyboard-layout-permanently?_=1609863007586
      and there is already a request here
      https://redmine.pfsense.org/issues/9942
      they will do it sooner or later but it's not a priority 🤷

      ̿' ̿'\̵͇̿̿\з=(◕_◕)=ε/̵͇̿̿/'̿'̿ ̿
      Please do not use chat/PM to ask for help
      we must focus on silencing this @guest character. we must make up lies and alter the copyrights !
      Don't forget to Upvote with the 👍 button for any post you find to be helpful.

      F 1 Reply Last reply Jan 5, 2021, 6:00 PM Reply Quote 0
      • F
        fog @kiokoman
        last edited by Jan 5, 2021, 6:00 PM

        @kiokoman
        hi kickoman, In troubleshooting I saw the discussion you mentioned and the feature request for pfsense and both were very helpful. However, finding (to my surprise) that / usr / share / locale / <folder> was empty for each "folder" was the most time-consuming task :-).
        Hopefully later versions of pfsense will provide a minimal configuration for localization files and for keyboard layout.

        K 1 Reply Last reply Jan 5, 2021, 6:26 PM Reply Quote 0
        • K
          kiokoman LAYER 8 @fog
          last edited by Jan 5, 2021, 6:26 PM

          @fog
          yes but that folder isn't necessary for the keyboard layout afaik, that contain only translation/transformation like
          yes=sì
          January=Gennaio
          and so on
          LC_COLLATE String sort order
          LC_CTYPE Character classification
          LC_MESSAGES Language of messages
          LC_MONETARY Formatting of currency amounts
          LC_NUMERIC Formatting of numbers
          LC_TIME Formatting of dates and times

          ̿' ̿'\̵͇̿̿\з=(◕_◕)=ε/̵͇̿̿/'̿'̿ ̿
          Please do not use chat/PM to ask for help
          we must focus on silencing this @guest character. we must make up lies and alter the copyrights !
          Don't forget to Upvote with the 👍 button for any post you find to be helpful.

          F 3 Replies Last reply Jan 5, 2021, 6:32 PM Reply Quote 0
          • F
            fog
            last edited by Jan 5, 2021, 6:27 PM

            And, at the end, when things get bad, there's no escape from having a useful shell!

            1 Reply Last reply Reply Quote 0
            • F
              fog @kiokoman
              last edited by fog Jan 5, 2021, 6:32 PM Jan 5, 2021, 6:32 PM

              @kiokoman
              yes, in fact I subdivided my problem into two subproblems.

              1. keyboard mapping
              2. localization
              1 Reply Last reply Reply Quote 0
              • F
                fog @kiokoman
                last edited by Jan 5, 2021, 6:38 PM

                @kiokoman
                as you can see I've chosen (not by chance) lang=en_US.UTF-8 and NOT lang=it_IT.UTF-8.

                1 Reply Last reply Reply Quote 1
                • F
                  fog @kiokoman
                  last edited by fog Jan 8, 2021, 6:23 PM Jan 8, 2021, 6:22 PM

                  @kiokoman said in Pfsense localization connecting on console or via SSH:

                  @fog
                  yes but that folder isn't necessary for the keyboard layout afaik, that contain only translation/transformation like
                  yes=sì
                  January=Gennaio
                  and so on
                  LC_COLLATE String sort order
                  LC_CTYPE Character classification
                  LC_MESSAGES Language of messages
                  LC_MONETARY Formatting of currency amounts
                  LC_NUMERIC Formatting of numbers
                  LC_TIME Formatting of dates and times

                  Anyway, If the correct encoding is not correctly and consistently set (in this case UTF-8) you have trouble to type characters outside the ASCII range as, for example, accented characters.

                  V 1 Reply Last reply Jan 15, 2021, 5:17 AM Reply Quote 0
                  • V
                    viktor_g Netgate @fog
                    last edited by Jan 15, 2021, 5:17 AM

                    This post is deleted!
                    1 Reply Last reply Reply Quote 0
                    1 out of 9
                    • First post
                      1/9
                      Last post
                    Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
                      This community forum collects and processes your personal information.
                      consent.not_received