Navigation

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

    Pfsense localization connecting on console or via SSH

    General pfSense Questions
    3
    9
    190
    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.
    • fog
      fog last edited by

      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

      kiokoman 1 Reply Last reply Reply Quote 0
      • kiokoman
        kiokoman LAYER 8 @fog last edited by kiokoman

        @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 🤷

        fog 1 Reply Last reply Reply Quote 0
        • fog
          fog @kiokoman last edited by

          @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.

          kiokoman 1 Reply Last reply Reply Quote 0
          • kiokoman
            kiokoman LAYER 8 @fog last edited by

            @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

            fog 3 Replies Last reply Reply Quote 0
            • fog
              fog last edited by

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

              1 Reply Last reply Reply Quote 0
              • fog
                fog @kiokoman last edited by fog

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

                1. keyboard mapping
                2. localization
                1 Reply Last reply Reply Quote 0
                • fog
                  fog @kiokoman last edited by

                  @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
                  • fog
                    fog @kiokoman last edited by fog

                    @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.

                    viktor_g 1 Reply Last reply Reply Quote 0
                    • viktor_g
                      viktor_g Netgate @fog last edited by

                      This post is deleted!
                      1 Reply Last reply Reply Quote 0
                      • First post
                        Last post

                      Products

                      • Platform Overview
                      • TNSR
                      • pfSense
                      • Appliances

                      Services

                      • Training
                      • Professional Services

                      Support

                      • Subscription Plans
                      • Contact Support
                      • Product Lifecycle
                      • Documentation

                      News

                      • Media Coverage
                      • Press
                      • Events

                      Resources

                      • Blog
                      • FAQ
                      • Find a Partner
                      • Resource Library
                      • Security Information

                      Company

                      • About Us
                      • Careers
                      • Partners
                      • Contact Us
                      • Legal
                      Our Mission

                      We provide leading-edge network security at a fair price - regardless of organizational size or network sophistication. We believe that an open-source security model offers disruptive pricing along with the agility required to quickly address emerging threats.

                      Subscribe to our Newsletter

                      Product information, software announcements, and special offers. See our newsletter archive to sign up for future newsletters and to read past announcements.

                      © 2021 Rubicon Communications, LLC | Privacy Policy