• Recent
    • Unsolved
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Installation stops during setting up fogproject password

    Scheduled Pinned Locked Moved Solved
    FOG Problems
    6
    39
    6.7k
    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.
    • D
      Deimos @Tom Elliott
      last edited by Deimos

      @Tom-Elliott said in Installation stops during setting up fogproject password:

      cat /dev/urandom | tr -dc ‘0-9a-zA-Z!#$%&()*+,-./:;<=>?@[]^_{|}~’ | head -c ${1:-12}

      [root@fog-ls15nb ~]# cat /dev/urandom | tr -dc '0-9a-zA-Z!#$%&()*+,-./:;<=>?@[]^_{|}~' | head -c ${1:-12}
      (02;(D~#ZFBHtr: Schreibfehler: Broken pipe
      tr: Schreibfehler
      cat: Schreibfehler: Broken pipe
      [root@fog-ls15nb ~]#
      

      Just a note: Thanks for the help so far and for your patience.

      Tom ElliottT 1 Reply Last reply Reply Quote 0
      • Tom ElliottT
        Tom Elliott @Deimos
        last edited by

        @Deimos said in Installation stops during setting up fogproject password:
        How about:

        tr -dc '0-9a-zA-Z!#$%&()*+,-./:;<=>?@[]^_{|}~' < /dev/urandom | head -c ${1:-12}

        Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

        Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

        Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

        1 Reply Last reply Reply Quote 0
        • Tom ElliottT
          Tom Elliott
          last edited by

          Another option that doesn’t seem to loop forever:

          head /dev/urandom | tr -dc '0-9a-zA-Z!#$%&()*+,-./:;<=>?@[]^_{|}~' | fold -w12 | shuf -n1
          

          What this one does, it breaks at the first new line urandom gives (so much faster return and not infinite loop), pipes that output to tr, folds it to a width of 12 characters, and shuffles the data returned from the fold.

          Hopefully this may help?

          Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

          Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

          Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

          1 Reply Last reply Reply Quote 1
          • D
            Deimos
            last edited by

            @Tom-Elliott said in Installation stops during setting up fogproject password:

            tr -dc ‘0-9a-zA-Z!#$%&()*+,-./:;<=>?@[]^_{|}~’ < /dev/urandom | head -c ${1:-12}

            [root@fog-ls15nb ~]# tr -dc '0-9a-zA-Z!#$%&()*+,-./:;<=>?@[]^_{|}~' < /dev/urandom | head -c ${1:-12}
            2>}?w0vfI8o]tr: Schreibfehler: Broken pipe
            tr: Schreibfehler
            [root@fog-ls15nb ~]# 
            

            Think this works:

            [root@fog-ls15nb ~]# head /dev/urandom | tr -dc '0-9a-zA-Z!#$%&()*+,-./:;<=>?@[]^_{|}~' | fold -w12 | shuf -n1
            !F!lOldRC)r6
            [root@fog-ls15nb ~]# 
            

            But where can I add/replace this to the installation-script?

            1 Reply Last reply Reply Quote 0
            • S
              Sebastian Roth Moderator
              last edited by

              @Deimos said in Installation stops during setting up fogproject password:

              But where can I add/replace this to the installation-script?

              Take a look here: https://github.com/FOGProject/fogproject/blob/master/lib/common/functions.sh#L1261

              You find that file in fogproject/lib/common/functions.sh on your system…

              Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

              Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

              1 Reply Last reply Reply Quote 1
              • D
                Deimos
                last edited by

                Thanks, I will try this tomorrow.

                1 Reply Last reply Reply Quote 0
                • Wayne WorkmanW
                  Wayne Workman
                  last edited by

                  it seems generating passwords in fog has been an issue for a while… be it special characters that need handled or double vs single quotes to contain it…

                  Lately in my own projects, I opt for very long passwords made from upper & lower case letters and numbers randomly. I’m talking 32, or 64 characters long. Typically I look up the maximum length supported password, and generate one of that length, just letters and numbers.

                  Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!
                  Daily Clean Installation Results:
                  https://fogtesting.fogproject.us/
                  FOG Reporting:
                  https://fog-external-reporting-results.fogproject.us/

                  D 1 Reply Last reply Reply Quote 0
                  • D
                    Deimos
                    last edited by Deimos

                    Works. Well done, everybody.

                    do
                            [[ -z $password || $ret -ne 999 ]] && password=$(head /dev/urandom | tr -cd '0-9a-zA-Z' | fold -w12 | shuf -n1)
                            echo -e "$password\n$password" | passwd $username >>$workingdir/error_logs/fog_error_${version}.log 2>&1
                            ret=$?
                            let cnt+=1
                        done
                    

                    Special thanks to @Sebastian-Roth for patience and to stay in touch.

                    1 Reply Last reply Reply Quote 0
                    • S
                      Sebastian Roth Moderator
                      last edited by

                      @Wayne-Workman said in Installation stops during setting up fogproject password:

                      it seems generating passwords in fog has been an issue for a while… be it special characters that need handled or double vs single quotes to contain it…
                      Lately in my own projects, I opt for very long passwords made from upper & lower case letters and numbers randomly. I’m talking 32, or 64 characters long. Typically I look up the maximum length supported password, and generate one of that length, just letters and numbers.

                      Good point you have there. Early this year we started thinking about moving to better password policy in general. Not using an empty password for mysql, setting a random passphrase for the web UI login and such. As sort of a preperation I committed a change that moves away from the original openssl rand -base64 32 because I thought people wouldn’t even bother about trying to memorize a 32 length password (web UI login). But I got somehow sidetracked by too many other things and never finished what I initially thought about: Having different levels of complexity passwords instead of one fits all.

                      So we might discuss this now before we change things again.

                      Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

                      Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

                      1 Reply Last reply Reply Quote 2
                      • D
                        Deimos @Wayne Workman
                        last edited by

                        @Wayne-Workman said in Installation stops during setting up fogproject password:

                        own projects, I opt for very long passwords made from upper & lower case letters and numbers randomly. I’m talking 32, or 64 characters long. Typically I look up the maximum length supported password, and generate one of that length, just letters and numbers.

                        I tried another installation on an other, identical notebook fujitsu lifebook with fedora server 30, but allowed special characters in the function.sh and it works also.

                        do
                                [[ -z $password || $ret -ne 999 ]] && password=$(head /dev/urandom | '0-9a-zA-Z!#$%&()*+,-./:;<=>?@[]^_{|}~' | fold -w12 | shuf -n1)
                                echo -e "$password\n$password" | passwd $username >>$workingdir/error_logs/fog_error_${version}.log 2>&1
                                ret=$?
                                let cnt+=1
                            done
                        
                        1 Reply Last reply Reply Quote 0
                        • 1
                        • 2
                        • 2 / 2
                        • First post
                          Last post

                        178

                        Online

                        12.1k

                        Users

                        17.3k

                        Topics

                        155.4k

                        Posts
                        Copyright © 2012-2024 FOG Project