Solaris 10 create username with blank password

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
-1
down vote

favorite












How to create a script that will create a new user with a blank password in Solaris 10?







share|improve this question


















  • 3




    What have you tested so far?
    – Kevin Lemaire
    Jan 31 at 10:45










  • passwd -d $user will delete any password field from a user.
    – Tim Kennedy
    Feb 2 at 18:06














up vote
-1
down vote

favorite












How to create a script that will create a new user with a blank password in Solaris 10?







share|improve this question


















  • 3




    What have you tested so far?
    – Kevin Lemaire
    Jan 31 at 10:45










  • passwd -d $user will delete any password field from a user.
    – Tim Kennedy
    Feb 2 at 18:06












up vote
-1
down vote

favorite









up vote
-1
down vote

favorite











How to create a script that will create a new user with a blank password in Solaris 10?







share|improve this question














How to create a script that will create a new user with a blank password in Solaris 10?









share|improve this question













share|improve this question




share|improve this question








edited Jan 31 at 10:24









Yaron

3,19421027




3,19421027










asked Jan 31 at 10:14









user3581641

1




1







  • 3




    What have you tested so far?
    – Kevin Lemaire
    Jan 31 at 10:45










  • passwd -d $user will delete any password field from a user.
    – Tim Kennedy
    Feb 2 at 18:06












  • 3




    What have you tested so far?
    – Kevin Lemaire
    Jan 31 at 10:45










  • passwd -d $user will delete any password field from a user.
    – Tim Kennedy
    Feb 2 at 18:06







3




3




What have you tested so far?
– Kevin Lemaire
Jan 31 at 10:45




What have you tested so far?
– Kevin Lemaire
Jan 31 at 10:45












passwd -d $user will delete any password field from a user.
– Tim Kennedy
Feb 2 at 18:06




passwd -d $user will delete any password field from a user.
– Tim Kennedy
Feb 2 at 18:06










2 Answers
2






active

oldest

votes

















up vote
0
down vote













Why do you need a script to create 1 user? You can just use useradd -m username.



If you want to create multiple users, make a file with all the usernames, lets call it usernames. Then this for loop will be able to help you out.



for i in $( cat usernames ); do
useradd -m $i
echo "Adding user $i"
echo $i:"P@ssW0rd" | chpasswd
done


You can also use the while loop as @Kusalananda pointed out :



while read username ;do
useradd -m $username
echo "Adding user $username"
echo $username:"P@ssW0rd" | chpasswd
done < usernames





share|improve this answer


















  • 1




    What's with the cat? Why not while read ... done <usernames?
    – Kusalananda
    Jan 31 at 11:39










  • @Kusalananda, I usually use the for loop for these kind of things, not too familiar with the while loop and with the < file.
    – Hunter.S.Thompson
    Jan 31 at 11:43










  • Hi Gurus, my boss requirement is to create a user with blank password on Solaris 10. I want know know if you happen to have a script the will automatically create user with blank password or with standard password (P@ssW0rd). The trick is that when you create a new user the password should have no user intervention. Here is the Example. # Script.sh (username) (password)
    – user3581641
    Jan 31 at 12:53










  • When you execute passwd it will require user intervention to keyin the password 2 times. I want to have a script that will eliminate the user intervention so everytime i create a new user with default password it has no user intervention. Thanks
    – user3581641
    Jan 31 at 12:57










  • You should add that to your question then.
    – Hunter.S.Thompson
    Jan 31 at 12:58

















up vote
0
down vote













I don't believe there is package for it under Solaris 10 (they added it to v11), but you could use expect. It's easy to use, as well as compile. I've done this in the past on Solaris 10 for various efforts.



http://expect.sourceforge.net/



They may even have an example that will meet your needs as a few are password related.






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',
    convertImagesToLinks: false,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    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%2f420894%2fsolaris-10-create-username-with-blank-password%23new-answer', 'question_page');

    );

    Post as a guest






























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote













    Why do you need a script to create 1 user? You can just use useradd -m username.



    If you want to create multiple users, make a file with all the usernames, lets call it usernames. Then this for loop will be able to help you out.



    for i in $( cat usernames ); do
    useradd -m $i
    echo "Adding user $i"
    echo $i:"P@ssW0rd" | chpasswd
    done


    You can also use the while loop as @Kusalananda pointed out :



    while read username ;do
    useradd -m $username
    echo "Adding user $username"
    echo $username:"P@ssW0rd" | chpasswd
    done < usernames





    share|improve this answer


















    • 1




      What's with the cat? Why not while read ... done <usernames?
      – Kusalananda
      Jan 31 at 11:39










    • @Kusalananda, I usually use the for loop for these kind of things, not too familiar with the while loop and with the < file.
      – Hunter.S.Thompson
      Jan 31 at 11:43










    • Hi Gurus, my boss requirement is to create a user with blank password on Solaris 10. I want know know if you happen to have a script the will automatically create user with blank password or with standard password (P@ssW0rd). The trick is that when you create a new user the password should have no user intervention. Here is the Example. # Script.sh (username) (password)
      – user3581641
      Jan 31 at 12:53










    • When you execute passwd it will require user intervention to keyin the password 2 times. I want to have a script that will eliminate the user intervention so everytime i create a new user with default password it has no user intervention. Thanks
      – user3581641
      Jan 31 at 12:57










    • You should add that to your question then.
      – Hunter.S.Thompson
      Jan 31 at 12:58














    up vote
    0
    down vote













    Why do you need a script to create 1 user? You can just use useradd -m username.



    If you want to create multiple users, make a file with all the usernames, lets call it usernames. Then this for loop will be able to help you out.



    for i in $( cat usernames ); do
    useradd -m $i
    echo "Adding user $i"
    echo $i:"P@ssW0rd" | chpasswd
    done


    You can also use the while loop as @Kusalananda pointed out :



    while read username ;do
    useradd -m $username
    echo "Adding user $username"
    echo $username:"P@ssW0rd" | chpasswd
    done < usernames





    share|improve this answer


















    • 1




      What's with the cat? Why not while read ... done <usernames?
      – Kusalananda
      Jan 31 at 11:39










    • @Kusalananda, I usually use the for loop for these kind of things, not too familiar with the while loop and with the < file.
      – Hunter.S.Thompson
      Jan 31 at 11:43










    • Hi Gurus, my boss requirement is to create a user with blank password on Solaris 10. I want know know if you happen to have a script the will automatically create user with blank password or with standard password (P@ssW0rd). The trick is that when you create a new user the password should have no user intervention. Here is the Example. # Script.sh (username) (password)
      – user3581641
      Jan 31 at 12:53










    • When you execute passwd it will require user intervention to keyin the password 2 times. I want to have a script that will eliminate the user intervention so everytime i create a new user with default password it has no user intervention. Thanks
      – user3581641
      Jan 31 at 12:57










    • You should add that to your question then.
      – Hunter.S.Thompson
      Jan 31 at 12:58












    up vote
    0
    down vote










    up vote
    0
    down vote









    Why do you need a script to create 1 user? You can just use useradd -m username.



    If you want to create multiple users, make a file with all the usernames, lets call it usernames. Then this for loop will be able to help you out.



    for i in $( cat usernames ); do
    useradd -m $i
    echo "Adding user $i"
    echo $i:"P@ssW0rd" | chpasswd
    done


    You can also use the while loop as @Kusalananda pointed out :



    while read username ;do
    useradd -m $username
    echo "Adding user $username"
    echo $username:"P@ssW0rd" | chpasswd
    done < usernames





    share|improve this answer














    Why do you need a script to create 1 user? You can just use useradd -m username.



    If you want to create multiple users, make a file with all the usernames, lets call it usernames. Then this for loop will be able to help you out.



    for i in $( cat usernames ); do
    useradd -m $i
    echo "Adding user $i"
    echo $i:"P@ssW0rd" | chpasswd
    done


    You can also use the while loop as @Kusalananda pointed out :



    while read username ;do
    useradd -m $username
    echo "Adding user $username"
    echo $username:"P@ssW0rd" | chpasswd
    done < usernames






    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Jan 31 at 13:02

























    answered Jan 31 at 10:51









    Hunter.S.Thompson

    4,50631334




    4,50631334







    • 1




      What's with the cat? Why not while read ... done <usernames?
      – Kusalananda
      Jan 31 at 11:39










    • @Kusalananda, I usually use the for loop for these kind of things, not too familiar with the while loop and with the < file.
      – Hunter.S.Thompson
      Jan 31 at 11:43










    • Hi Gurus, my boss requirement is to create a user with blank password on Solaris 10. I want know know if you happen to have a script the will automatically create user with blank password or with standard password (P@ssW0rd). The trick is that when you create a new user the password should have no user intervention. Here is the Example. # Script.sh (username) (password)
      – user3581641
      Jan 31 at 12:53










    • When you execute passwd it will require user intervention to keyin the password 2 times. I want to have a script that will eliminate the user intervention so everytime i create a new user with default password it has no user intervention. Thanks
      – user3581641
      Jan 31 at 12:57










    • You should add that to your question then.
      – Hunter.S.Thompson
      Jan 31 at 12:58












    • 1




      What's with the cat? Why not while read ... done <usernames?
      – Kusalananda
      Jan 31 at 11:39










    • @Kusalananda, I usually use the for loop for these kind of things, not too familiar with the while loop and with the < file.
      – Hunter.S.Thompson
      Jan 31 at 11:43










    • Hi Gurus, my boss requirement is to create a user with blank password on Solaris 10. I want know know if you happen to have a script the will automatically create user with blank password or with standard password (P@ssW0rd). The trick is that when you create a new user the password should have no user intervention. Here is the Example. # Script.sh (username) (password)
      – user3581641
      Jan 31 at 12:53










    • When you execute passwd it will require user intervention to keyin the password 2 times. I want to have a script that will eliminate the user intervention so everytime i create a new user with default password it has no user intervention. Thanks
      – user3581641
      Jan 31 at 12:57










    • You should add that to your question then.
      – Hunter.S.Thompson
      Jan 31 at 12:58







    1




    1




    What's with the cat? Why not while read ... done <usernames?
    – Kusalananda
    Jan 31 at 11:39




    What's with the cat? Why not while read ... done <usernames?
    – Kusalananda
    Jan 31 at 11:39












    @Kusalananda, I usually use the for loop for these kind of things, not too familiar with the while loop and with the < file.
    – Hunter.S.Thompson
    Jan 31 at 11:43




    @Kusalananda, I usually use the for loop for these kind of things, not too familiar with the while loop and with the < file.
    – Hunter.S.Thompson
    Jan 31 at 11:43












    Hi Gurus, my boss requirement is to create a user with blank password on Solaris 10. I want know know if you happen to have a script the will automatically create user with blank password or with standard password (P@ssW0rd). The trick is that when you create a new user the password should have no user intervention. Here is the Example. # Script.sh (username) (password)
    – user3581641
    Jan 31 at 12:53




    Hi Gurus, my boss requirement is to create a user with blank password on Solaris 10. I want know know if you happen to have a script the will automatically create user with blank password or with standard password (P@ssW0rd). The trick is that when you create a new user the password should have no user intervention. Here is the Example. # Script.sh (username) (password)
    – user3581641
    Jan 31 at 12:53












    When you execute passwd it will require user intervention to keyin the password 2 times. I want to have a script that will eliminate the user intervention so everytime i create a new user with default password it has no user intervention. Thanks
    – user3581641
    Jan 31 at 12:57




    When you execute passwd it will require user intervention to keyin the password 2 times. I want to have a script that will eliminate the user intervention so everytime i create a new user with default password it has no user intervention. Thanks
    – user3581641
    Jan 31 at 12:57












    You should add that to your question then.
    – Hunter.S.Thompson
    Jan 31 at 12:58




    You should add that to your question then.
    – Hunter.S.Thompson
    Jan 31 at 12:58












    up vote
    0
    down vote













    I don't believe there is package for it under Solaris 10 (they added it to v11), but you could use expect. It's easy to use, as well as compile. I've done this in the past on Solaris 10 for various efforts.



    http://expect.sourceforge.net/



    They may even have an example that will meet your needs as a few are password related.






    share|improve this answer
























      up vote
      0
      down vote













      I don't believe there is package for it under Solaris 10 (they added it to v11), but you could use expect. It's easy to use, as well as compile. I've done this in the past on Solaris 10 for various efforts.



      http://expect.sourceforge.net/



      They may even have an example that will meet your needs as a few are password related.






      share|improve this answer






















        up vote
        0
        down vote










        up vote
        0
        down vote









        I don't believe there is package for it under Solaris 10 (they added it to v11), but you could use expect. It's easy to use, as well as compile. I've done this in the past on Solaris 10 for various efforts.



        http://expect.sourceforge.net/



        They may even have an example that will meet your needs as a few are password related.






        share|improve this answer












        I don't believe there is package for it under Solaris 10 (they added it to v11), but you could use expect. It's easy to use, as well as compile. I've done this in the past on Solaris 10 for various efforts.



        http://expect.sourceforge.net/



        They may even have an example that will meet your needs as a few are password related.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Feb 1 at 22:27









        sleepyweasel

        86319




        86319






















             

            draft saved


            draft discarded


























             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f420894%2fsolaris-10-create-username-with-blank-password%23new-answer', 'question_page');

            );

            Post as a guest













































































            Popular posts from this blog

            How to check contact read email or not when send email to Individual?

            Displaying single band from multi-band raster using QGIS

            How many registers does an x86_64 CPU actually have?