possible to make samba use /etc/shadowsamba with OpenLDAP - NT_STATUS_NO_SUCH_USERSamba 2.2.12 accepts my...

Chess software to analyze games

What is the evidence on the danger of feeding whole blueberries and grapes to infants and toddlers?

Stuffing in the middle

Count the frequency of integers in an array

Default camera device to show screen instead of physical camera

iPhone 8 purchased through AT&T change to T-Mobile

Why doesn't mathematics collapse down, even though humans quite often make mistakes in their proofs?

How to get distinct values from an array of arrays in JavaScript using the filter() method?

Why doesn't the Falcon-9 first stage use three legs to land?

How big would a Daddy Longlegs Spider need to be to kill an average Human?

Nuclear decay triggers

How do you call it when two celestial bodies come as close to each other as they will in their current orbits?

Do predators tend to have vertical slit pupils versus horizontal for prey animals?

Earliest evidence of objects intended for future archaeologists?

How could Tony Stark wield the Infinity Nano Gauntlet - at all?

Are illustrations in novels frowned upon?

How to dismiss intrusive questions from a colleague with whom I don't work?

How to decide whether an eshop is safe or compromised

What is the latest version of SQL Server native client that is compatible with Sql Server 2008 r2

What professions does medieval village with a population of 100 need?

Convert HTML color to OLE

Count the frequency of items in an array

What happens when two creatures actually share the same turn?

Is Eldritch Blast affected by antimagic field



possible to make samba use /etc/shadow


samba with OpenLDAP - NT_STATUS_NO_SUCH_USERSamba 2.2.12 accepts my password, but is rejecting other user accounts?set samba password now can't loginSamba - Allow users to change its own password






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







1















this would be for whatever Samba versions are in RHEL/CentOS >= 7.6.

I think Samba >= 4.8.



for each user account to be able to have samba access I do smbpasswd -a <user>. As such the user's system login password is independent of the samba password.



Is there a way such that




  • a user NEVER has to do smbpasswd

  • samba works off the password from /etc/shadow










share|improve this question































    1















    this would be for whatever Samba versions are in RHEL/CentOS >= 7.6.

    I think Samba >= 4.8.



    for each user account to be able to have samba access I do smbpasswd -a <user>. As such the user's system login password is independent of the samba password.



    Is there a way such that




    • a user NEVER has to do smbpasswd

    • samba works off the password from /etc/shadow










    share|improve this question



























      1












      1








      1








      this would be for whatever Samba versions are in RHEL/CentOS >= 7.6.

      I think Samba >= 4.8.



      for each user account to be able to have samba access I do smbpasswd -a <user>. As such the user's system login password is independent of the samba password.



      Is there a way such that




      • a user NEVER has to do smbpasswd

      • samba works off the password from /etc/shadow










      share|improve this question














      this would be for whatever Samba versions are in RHEL/CentOS >= 7.6.

      I think Samba >= 4.8.



      for each user account to be able to have samba access I do smbpasswd -a <user>. As such the user's system login password is independent of the samba password.



      Is there a way such that




      • a user NEVER has to do smbpasswd

      • samba works off the password from /etc/shadow







      samba samba4






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Aug 17 at 0:45









      ronron

      1,2952 gold badges9 silver badges22 bronze badges




      1,2952 gold badges9 silver badges22 bronze badges

























          2 Answers
          2






          active

          oldest

          votes


















          1














          The problem: incompatible password hashing methods



          Back in Windows NT4 / Windows 2000 era, it was possible - and in fact fairly common - to set up Samba authentication in the way that would satisfy your requirements. But even back then, Samba documentation strongly recommended against doing that, because it had one big glaring security flaw: it required the passwords to be sent unencrypted over the network. Even back then, it was a bad idea; with modern ubiquity of wireless networks and bring-your-own-device solutions, sending passwords unencrypted over the network is completely unacceptable.



          Neither Windows nor Linux stores system passwords in plaintext. Instead, the password and a salt value are one-way hashed, and the salt value and the resulting hash are stored. As a result, nothing and nobody (not even the system administrator) can easily recover the plaintext version for your password from the stored hashes for any purpose. It would always require bruteforcing or massive rainbow tables.



          When a password needs to be checked, the stored password is not decrypted, because that is essentially impossible. Instead, the algorithm looks up the salt value of the user in question, and uses that to hash the password entered by the user, and then compares the resulting hash with the stored hash: if they match exactly, the password was correct.



          Doing this over the network requires still more protection. If the server would just give the salt value to the client and wait for the client to supply a hashed password, the data passed over the network would be password-equivalent and an attacker listening in could simply reuse the hashes as-is with a modified evil client. This was known as the "replay attack", or "pass-the-hash attack".



          As a result, when a Windows or Samba client produces an encrypted authentication packet to be passwd over the network, it needs to use a hashing scheme that is compatible with the replay attack protection. But this also makes it impossible for the server to return the Windows-style password hash to a plaintext form it would need to begin checking it against the hashes in /etc/shadow.



          The solution



          The only place this could be fixed is the password changing process: at that point, the plaintext version of the password must necessarily be known to the server so that it can be hashed and stored. It is in fact possible to modify this process to update both the system login password and the Samba password at the same time.



          If your Samba servers are not domain controllers, you can enable the unix password sync parameter in smb.conf file, and specify the passwd program to allow Samba to automatically update the corresponding system login password whenever a Samba password is updated. If you do this, you would need to instruct your users to always use smbpasswd, never passwd.



          Alternatively, you could add the PAM module pam_smbpass.so to the PAM configuration of the system. It is available as a RPM package for both RHEL/CentOS 6.x and 7.x.



          There are two ways to use pam_smbpass.so: either use the Samba password storage as the primary system password storage for all services using PAM (and essentially everything uses PAM, unless you have a need to use some horrible built-from-ancient-source legacy Unix program), or just plug it in the PAM-based password-changing process so that the regular passwd command (or any other PAM-based method to update the system login password) will update both /etc/shadow and the Samba password at the same time. Then your users could always use passwd and never smbpasswd.






          share|improve this answer


























          • bug reports and such seem to indicate pam_smbpass is deprecated and dropped from samba4, specifically pam_smbpass.so migrate and that a possible solution might be pam_winbind.so

            – ron
            16 hours ago



















          0














          Unless you're planning on a large-scale user roll-out with Samba, I would strongly suggest doing it the way you are. Samba basically has (2) choices for usernames/passwords database backends: tdbsam (the default) or ldapsam. If you want to install/configure ldap, then you can setup Samba to use it. Check out man smb.conf for more details.



          EDIT: you can also get Samba to authenticate through a Windows domain controller.






          share|improve this answer






























            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "106"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f535967%2fpossible-to-make-samba-use-etc-shadow%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            1














            The problem: incompatible password hashing methods



            Back in Windows NT4 / Windows 2000 era, it was possible - and in fact fairly common - to set up Samba authentication in the way that would satisfy your requirements. But even back then, Samba documentation strongly recommended against doing that, because it had one big glaring security flaw: it required the passwords to be sent unencrypted over the network. Even back then, it was a bad idea; with modern ubiquity of wireless networks and bring-your-own-device solutions, sending passwords unencrypted over the network is completely unacceptable.



            Neither Windows nor Linux stores system passwords in plaintext. Instead, the password and a salt value are one-way hashed, and the salt value and the resulting hash are stored. As a result, nothing and nobody (not even the system administrator) can easily recover the plaintext version for your password from the stored hashes for any purpose. It would always require bruteforcing or massive rainbow tables.



            When a password needs to be checked, the stored password is not decrypted, because that is essentially impossible. Instead, the algorithm looks up the salt value of the user in question, and uses that to hash the password entered by the user, and then compares the resulting hash with the stored hash: if they match exactly, the password was correct.



            Doing this over the network requires still more protection. If the server would just give the salt value to the client and wait for the client to supply a hashed password, the data passed over the network would be password-equivalent and an attacker listening in could simply reuse the hashes as-is with a modified evil client. This was known as the "replay attack", or "pass-the-hash attack".



            As a result, when a Windows or Samba client produces an encrypted authentication packet to be passwd over the network, it needs to use a hashing scheme that is compatible with the replay attack protection. But this also makes it impossible for the server to return the Windows-style password hash to a plaintext form it would need to begin checking it against the hashes in /etc/shadow.



            The solution



            The only place this could be fixed is the password changing process: at that point, the plaintext version of the password must necessarily be known to the server so that it can be hashed and stored. It is in fact possible to modify this process to update both the system login password and the Samba password at the same time.



            If your Samba servers are not domain controllers, you can enable the unix password sync parameter in smb.conf file, and specify the passwd program to allow Samba to automatically update the corresponding system login password whenever a Samba password is updated. If you do this, you would need to instruct your users to always use smbpasswd, never passwd.



            Alternatively, you could add the PAM module pam_smbpass.so to the PAM configuration of the system. It is available as a RPM package for both RHEL/CentOS 6.x and 7.x.



            There are two ways to use pam_smbpass.so: either use the Samba password storage as the primary system password storage for all services using PAM (and essentially everything uses PAM, unless you have a need to use some horrible built-from-ancient-source legacy Unix program), or just plug it in the PAM-based password-changing process so that the regular passwd command (or any other PAM-based method to update the system login password) will update both /etc/shadow and the Samba password at the same time. Then your users could always use passwd and never smbpasswd.






            share|improve this answer


























            • bug reports and such seem to indicate pam_smbpass is deprecated and dropped from samba4, specifically pam_smbpass.so migrate and that a possible solution might be pam_winbind.so

              – ron
              16 hours ago
















            1














            The problem: incompatible password hashing methods



            Back in Windows NT4 / Windows 2000 era, it was possible - and in fact fairly common - to set up Samba authentication in the way that would satisfy your requirements. But even back then, Samba documentation strongly recommended against doing that, because it had one big glaring security flaw: it required the passwords to be sent unencrypted over the network. Even back then, it was a bad idea; with modern ubiquity of wireless networks and bring-your-own-device solutions, sending passwords unencrypted over the network is completely unacceptable.



            Neither Windows nor Linux stores system passwords in plaintext. Instead, the password and a salt value are one-way hashed, and the salt value and the resulting hash are stored. As a result, nothing and nobody (not even the system administrator) can easily recover the plaintext version for your password from the stored hashes for any purpose. It would always require bruteforcing or massive rainbow tables.



            When a password needs to be checked, the stored password is not decrypted, because that is essentially impossible. Instead, the algorithm looks up the salt value of the user in question, and uses that to hash the password entered by the user, and then compares the resulting hash with the stored hash: if they match exactly, the password was correct.



            Doing this over the network requires still more protection. If the server would just give the salt value to the client and wait for the client to supply a hashed password, the data passed over the network would be password-equivalent and an attacker listening in could simply reuse the hashes as-is with a modified evil client. This was known as the "replay attack", or "pass-the-hash attack".



            As a result, when a Windows or Samba client produces an encrypted authentication packet to be passwd over the network, it needs to use a hashing scheme that is compatible with the replay attack protection. But this also makes it impossible for the server to return the Windows-style password hash to a plaintext form it would need to begin checking it against the hashes in /etc/shadow.



            The solution



            The only place this could be fixed is the password changing process: at that point, the plaintext version of the password must necessarily be known to the server so that it can be hashed and stored. It is in fact possible to modify this process to update both the system login password and the Samba password at the same time.



            If your Samba servers are not domain controllers, you can enable the unix password sync parameter in smb.conf file, and specify the passwd program to allow Samba to automatically update the corresponding system login password whenever a Samba password is updated. If you do this, you would need to instruct your users to always use smbpasswd, never passwd.



            Alternatively, you could add the PAM module pam_smbpass.so to the PAM configuration of the system. It is available as a RPM package for both RHEL/CentOS 6.x and 7.x.



            There are two ways to use pam_smbpass.so: either use the Samba password storage as the primary system password storage for all services using PAM (and essentially everything uses PAM, unless you have a need to use some horrible built-from-ancient-source legacy Unix program), or just plug it in the PAM-based password-changing process so that the regular passwd command (or any other PAM-based method to update the system login password) will update both /etc/shadow and the Samba password at the same time. Then your users could always use passwd and never smbpasswd.






            share|improve this answer


























            • bug reports and such seem to indicate pam_smbpass is deprecated and dropped from samba4, specifically pam_smbpass.so migrate and that a possible solution might be pam_winbind.so

              – ron
              16 hours ago














            1












            1








            1







            The problem: incompatible password hashing methods



            Back in Windows NT4 / Windows 2000 era, it was possible - and in fact fairly common - to set up Samba authentication in the way that would satisfy your requirements. But even back then, Samba documentation strongly recommended against doing that, because it had one big glaring security flaw: it required the passwords to be sent unencrypted over the network. Even back then, it was a bad idea; with modern ubiquity of wireless networks and bring-your-own-device solutions, sending passwords unencrypted over the network is completely unacceptable.



            Neither Windows nor Linux stores system passwords in plaintext. Instead, the password and a salt value are one-way hashed, and the salt value and the resulting hash are stored. As a result, nothing and nobody (not even the system administrator) can easily recover the plaintext version for your password from the stored hashes for any purpose. It would always require bruteforcing or massive rainbow tables.



            When a password needs to be checked, the stored password is not decrypted, because that is essentially impossible. Instead, the algorithm looks up the salt value of the user in question, and uses that to hash the password entered by the user, and then compares the resulting hash with the stored hash: if they match exactly, the password was correct.



            Doing this over the network requires still more protection. If the server would just give the salt value to the client and wait for the client to supply a hashed password, the data passed over the network would be password-equivalent and an attacker listening in could simply reuse the hashes as-is with a modified evil client. This was known as the "replay attack", or "pass-the-hash attack".



            As a result, when a Windows or Samba client produces an encrypted authentication packet to be passwd over the network, it needs to use a hashing scheme that is compatible with the replay attack protection. But this also makes it impossible for the server to return the Windows-style password hash to a plaintext form it would need to begin checking it against the hashes in /etc/shadow.



            The solution



            The only place this could be fixed is the password changing process: at that point, the plaintext version of the password must necessarily be known to the server so that it can be hashed and stored. It is in fact possible to modify this process to update both the system login password and the Samba password at the same time.



            If your Samba servers are not domain controllers, you can enable the unix password sync parameter in smb.conf file, and specify the passwd program to allow Samba to automatically update the corresponding system login password whenever a Samba password is updated. If you do this, you would need to instruct your users to always use smbpasswd, never passwd.



            Alternatively, you could add the PAM module pam_smbpass.so to the PAM configuration of the system. It is available as a RPM package for both RHEL/CentOS 6.x and 7.x.



            There are two ways to use pam_smbpass.so: either use the Samba password storage as the primary system password storage for all services using PAM (and essentially everything uses PAM, unless you have a need to use some horrible built-from-ancient-source legacy Unix program), or just plug it in the PAM-based password-changing process so that the regular passwd command (or any other PAM-based method to update the system login password) will update both /etc/shadow and the Samba password at the same time. Then your users could always use passwd and never smbpasswd.






            share|improve this answer













            The problem: incompatible password hashing methods



            Back in Windows NT4 / Windows 2000 era, it was possible - and in fact fairly common - to set up Samba authentication in the way that would satisfy your requirements. But even back then, Samba documentation strongly recommended against doing that, because it had one big glaring security flaw: it required the passwords to be sent unencrypted over the network. Even back then, it was a bad idea; with modern ubiquity of wireless networks and bring-your-own-device solutions, sending passwords unencrypted over the network is completely unacceptable.



            Neither Windows nor Linux stores system passwords in plaintext. Instead, the password and a salt value are one-way hashed, and the salt value and the resulting hash are stored. As a result, nothing and nobody (not even the system administrator) can easily recover the plaintext version for your password from the stored hashes for any purpose. It would always require bruteforcing or massive rainbow tables.



            When a password needs to be checked, the stored password is not decrypted, because that is essentially impossible. Instead, the algorithm looks up the salt value of the user in question, and uses that to hash the password entered by the user, and then compares the resulting hash with the stored hash: if they match exactly, the password was correct.



            Doing this over the network requires still more protection. If the server would just give the salt value to the client and wait for the client to supply a hashed password, the data passed over the network would be password-equivalent and an attacker listening in could simply reuse the hashes as-is with a modified evil client. This was known as the "replay attack", or "pass-the-hash attack".



            As a result, when a Windows or Samba client produces an encrypted authentication packet to be passwd over the network, it needs to use a hashing scheme that is compatible with the replay attack protection. But this also makes it impossible for the server to return the Windows-style password hash to a plaintext form it would need to begin checking it against the hashes in /etc/shadow.



            The solution



            The only place this could be fixed is the password changing process: at that point, the plaintext version of the password must necessarily be known to the server so that it can be hashed and stored. It is in fact possible to modify this process to update both the system login password and the Samba password at the same time.



            If your Samba servers are not domain controllers, you can enable the unix password sync parameter in smb.conf file, and specify the passwd program to allow Samba to automatically update the corresponding system login password whenever a Samba password is updated. If you do this, you would need to instruct your users to always use smbpasswd, never passwd.



            Alternatively, you could add the PAM module pam_smbpass.so to the PAM configuration of the system. It is available as a RPM package for both RHEL/CentOS 6.x and 7.x.



            There are two ways to use pam_smbpass.so: either use the Samba password storage as the primary system password storage for all services using PAM (and essentially everything uses PAM, unless you have a need to use some horrible built-from-ancient-source legacy Unix program), or just plug it in the PAM-based password-changing process so that the regular passwd command (or any other PAM-based method to update the system login password) will update both /etc/shadow and the Samba password at the same time. Then your users could always use passwd and never smbpasswd.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered 2 days ago









            telcoMtelcoM

            26.5k1 gold badge30 silver badges70 bronze badges




            26.5k1 gold badge30 silver badges70 bronze badges
















            • bug reports and such seem to indicate pam_smbpass is deprecated and dropped from samba4, specifically pam_smbpass.so migrate and that a possible solution might be pam_winbind.so

              – ron
              16 hours ago



















            • bug reports and such seem to indicate pam_smbpass is deprecated and dropped from samba4, specifically pam_smbpass.so migrate and that a possible solution might be pam_winbind.so

              – ron
              16 hours ago

















            bug reports and such seem to indicate pam_smbpass is deprecated and dropped from samba4, specifically pam_smbpass.so migrate and that a possible solution might be pam_winbind.so

            – ron
            16 hours ago





            bug reports and such seem to indicate pam_smbpass is deprecated and dropped from samba4, specifically pam_smbpass.so migrate and that a possible solution might be pam_winbind.so

            – ron
            16 hours ago













            0














            Unless you're planning on a large-scale user roll-out with Samba, I would strongly suggest doing it the way you are. Samba basically has (2) choices for usernames/passwords database backends: tdbsam (the default) or ldapsam. If you want to install/configure ldap, then you can setup Samba to use it. Check out man smb.conf for more details.



            EDIT: you can also get Samba to authenticate through a Windows domain controller.






            share|improve this answer
































              0














              Unless you're planning on a large-scale user roll-out with Samba, I would strongly suggest doing it the way you are. Samba basically has (2) choices for usernames/passwords database backends: tdbsam (the default) or ldapsam. If you want to install/configure ldap, then you can setup Samba to use it. Check out man smb.conf for more details.



              EDIT: you can also get Samba to authenticate through a Windows domain controller.






              share|improve this answer






























                0












                0








                0







                Unless you're planning on a large-scale user roll-out with Samba, I would strongly suggest doing it the way you are. Samba basically has (2) choices for usernames/passwords database backends: tdbsam (the default) or ldapsam. If you want to install/configure ldap, then you can setup Samba to use it. Check out man smb.conf for more details.



                EDIT: you can also get Samba to authenticate through a Windows domain controller.






                share|improve this answer















                Unless you're planning on a large-scale user roll-out with Samba, I would strongly suggest doing it the way you are. Samba basically has (2) choices for usernames/passwords database backends: tdbsam (the default) or ldapsam. If you want to install/configure ldap, then you can setup Samba to use it. Check out man smb.conf for more details.



                EDIT: you can also get Samba to authenticate through a Windows domain controller.







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Aug 17 at 2:03

























                answered Aug 17 at 1:49









                ajgringo619ajgringo619

                1459 bronze badges




                1459 bronze badges

































                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Unix & Linux Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f535967%2fpossible-to-make-samba-use-etc-shadow%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Taj Mahal Inhaltsverzeichnis Aufbau | Geschichte | 350-Jahr-Feier | Heutige Bedeutung | Siehe auch |...

                    Baia Sprie Cuprins Etimologie | Istorie | Demografie | Politică și administrație | Arii naturale...

                    Nicolae Petrescu-Găină Cuprins Biografie | Opera | In memoriam | Varia | Controverse, incertitudini...