useradd - Suse

This is a discussion on useradd - Suse ; hello, I have suse 10.2 and it is working fine I'm trying to make a script that in each line I can create a user and home directory and give it is password. The comand is useradd teste -g users ...

+ Reply to Thread
Results 1 to 11 of 11

Thread: useradd

  1. useradd

    hello,

    I have suse 10.2 and it is working fine I'm trying to make a script that in
    each line I can create a user and home directory and give it is password.

    The comand is
    useradd teste -g users -G users,dialout,video -m -d /home/teste -p teste



    but the password is not right for some reason!!



    If I do passwd teste and give it the same passwd teste it works fine!!!



    hat am I doing wrong



    Thank you



  2. Re: useradd

    Miguel Lopes wrote:

    > hello,
    >
    > I have suse 10.2 and it is working fine I'm trying to make a script that
    > in each line I can create a user and home directory and give it is
    > password.
    >
    > The comand is
    > useradd teste -g users Â*-G users,dialout,video -m -d /home/teste -p teste
    >
    >
    >
    > but the password is not right for some reason!!
    >
    >
    >
    > If I do passwd teste and give it the same passwd teste it works fine!!!
    >
    >
    >
    > hat am I doing wrong
    >
    >
    >
    > Thank you


    i can't help you with the script but why don't you use
    "user magagement" in yast?
    yast --> sercurity & users --> user magagement
    --
    EOS
    www.photo-memories.be
    Running KDE 3.5.7 / openSUSE 10.3 RC1

  3. Re: useradd


    "EOS" escreveu na mensagem
    news:qW9Mi.133734$j_5.6220850@phobos.telenet-ops.be...
    > Miguel Lopes wrote:
    >
    >> hello,
    >>
    >> I have suse 10.2 and it is working fine I'm trying to make a script that
    >> in each line I can create a user and home directory and give it is
    >> password.
    >>
    >> The comand is
    >> useradd teste -g users -G users,dialout,video -m -d /home/teste -p teste
    >>
    >>
    >>
    >> but the password is not right for some reason!!
    >>
    >>
    >>
    >> If I do passwd teste and give it the same passwd teste it works fine!!!
    >>
    >>
    >>
    >> hat am I doing wrong
    >>
    >>
    >>
    >> Thank you

    >
    > i can't help you with the script but why don't you use
    > "user magagement" in yast?
    > yast --> sercurity & users --> user magagement
    > --
    > EOS
    > www.photo-memories.be
    > Running KDE 3.5.7 / openSUSE 10.3 RC1


    Hi I want to make a script that I have all the users and all the password in
    a file in case the server goes down.

    Thanks



  4. Re: useradd

    Le Mon, 01 Oct 2007 19:19:27 +0200, Miguel Lopes
    a écrit:

    >
    > "EOS" escreveu na mensagem
    > news:qW9Mi.133734$j_5.6220850@phobos.telenet-ops.be...
    >> Miguel Lopes wrote:
    >>
    >>> hello,
    >>>
    >>> I have suse 10.2 and it is working fine I'm trying to make a script
    >>> that
    >>> in each line I can create a user and home directory and give it is
    >>> password.
    >>>
    >>> The comand is
    >>> useradd teste -g users -G users,dialout,video -m -d /home/teste -p
    >>> teste
    >>>
    >>>
    >>>
    >>> but the password is not right for some reason!!
    >>>
    >>>
    >>>
    >>> If I do passwd teste and give it the same passwd teste it works fine!!!
    >>>
    >>>
    >>>
    >>> hat am I doing wrong
    >>>
    >>>
    >>>
    >>> Thank you

    >>
    >> i can't help you with the script but why don't you use
    >> "user magagement" in yast?
    >> yast --> sercurity & users --> user magagement
    >> --
    >> EOS
    >> www.photo-memories.be
    >> Running KDE 3.5.7 / openSUSE 10.3 RC1

    >
    > Hi I want to make a script that I have all the users and all the
    > password in
    > a file in case the server goes down.
    >
    > Thanks
    >
    >

    I just think password should be encrypted NOT plain.

    We use the following (user also created into samba):

    #!/usr/local/bin/perl
    print "Util ";
    $usr=;
    chomp($usr);
    $usr or exit();
    print "Pwd:"; $pwd=;chomp($pwd);
    open FIC,">/var/tmp/tmp.tmp";
    print FIC "$pwd\n";print FIC "$pwd\n";close FIC;
    $st=`useradd -p \$(./crypt $pwd) $usr`;
    $st=$st;
    #creer dans samba
    $st=`cat /var/tmp/tmp.tmp|smbpasswd -as $usr`;
    $st=$st;
    `rm /var/tmp/tmp.tmp`;



    --
    J.Bratières

  5. Re: useradd

    On Mon, 1 Oct 2007 18:02:05 +0100
    "Miguel Lopes" wrote:

    > hello,
    >
    > I have suse 10.2 and it is working fine I'm trying to make a script
    > that in each line I can create a user and home directory and give it
    > is password.
    >
    > The comand is
    > useradd teste -g users -G users,dialout,video -m -d /home/teste -p
    > teste
    >
    >
    >
    > but the password is not right for some reason!!
    >
    >
    >
    > If I do passwd teste and give it the same passwd teste it works
    > fine!!!
    >
    >
    >
    > hat am I doing wrong
    >
    >
    >
    > Thank you
    >
    >

    Hi
    The account name goes at the end not the beginning.
    Why not backup your passwd and shadow files, then recreate via
    that, users will then have the same password etc.

    Also if you need to script adding users why not use ldap or such..?

    --
    Cheers Malcolm °¿° (Linux Counter #276890)
    SLED 10.0 SP1 x86_64 Kernel 2.6.16.53-0.8-smp
    up 2 days 14:35, 0 users, load average: 0.64, 0.58, 0.43

  6. Re: useradd

    Miguel Lopes wrote:
    > Hi I want to make a script that I have all the users and all the password in
    > a file in case the server goes down.


    Why not make backups? Having usernames and passwords in a file is
    extremely unsecure. Also it gives you more work then you gain from it.

    houghi
    --
    How do you ask a man to be the last man to die in Iraq?
    How do you ask a man to be the last man to die for a mistake?

  7. Re: useradd

    Miguel Lopes wrote:
    > hello,
    >
    > I have suse 10.2 and it is working fine I'm trying to make a script that in
    > each line I can create a user and home directory and give it is password.
    >
    > The comand is
    > useradd teste -g users -G users,dialout,video -m -d /home/teste -p teste
    >
    >
    >
    > but the password is not right for some reason!!
    >
    >
    >
    > If I do passwd teste and give it the same passwd teste it works fine!!!


    man chpasswd

    You can specify the password in encrypted or unecrypted form..

    /usr/sbin/chpasswd < teste:teste
    EOF

    >
    >
    >
    > hat am I doing wrong
    >
    >
    >
    > Thank you
    >
    >


  8. Re: useradd


    "Chris Cox" escreveu na mensagem
    news:13g2pbpiqovbfa1@corp.supernews.com...
    > Miguel Lopes wrote:
    >> hello,
    >>
    >> I have suse 10.2 and it is working fine I'm trying to make a script that
    >> in
    >> each line I can create a user and home directory and give it is password.
    >>
    >> The comand is
    >> useradd teste -g users -G users,dialout,video -m -d /home/teste -p teste
    >>
    >>
    >>
    >> but the password is not right for some reason!!
    >>
    >>
    >>
    >> If I do passwd teste and give it the same passwd teste it works fine!!!

    >
    > man chpasswd
    >
    > You can specify the password in encrypted or unecrypted form..
    >
    > /usr/sbin/chpasswd < > teste:teste
    > EOF
    >
    >>
    >>
    >>
    >> hat am I doing wrong
    >>
    >>
    >>
    >> Thank you
    >>
    >>


    my problem is that i'm building a mail server and there are already around
    100 people in the organization. If I have to do manually, input all the
    users and all the password that is going to be extremely painfull.

    I found a script it does what I want BUT not completly It creates the same
    passwd depending on the name here is the link
    http://www.howtoforge.com/user_passw..._a_bash_script

    Can anyone help me how can I create another file only for the password. and
    can be done automatically.

    thanks



  9. Re: useradd

    Miguel Lopes wrote:
    > "Chris Cox" escreveu na mensagem
    > news:13g2pbpiqovbfa1@corp.supernews.com...

    ....
    >>> If I do passwd teste and give it the same passwd teste it works fine!!!

    >> man chpasswd
    >>
    >> You can specify the password in encrypted or unecrypted form..
    >>
    >> /usr/sbin/chpasswd < >> teste:teste
    >> EOF
    >>

    .....
    > my problem is that i'm building a mail server and there are already around
    > 100 people in the organization. If I have to do manually, input all the
    > users and all the password that is going to be extremely painfull.
    >
    > I found a script it does what I want BUT not completly It creates the same
    > passwd depending on the name here is the link
    > http://www.howtoforge.com/user_passw..._a_bash_script
    >
    > Can anyone help me how can I create another file only for the password. and
    > can be done automatically.
    >



    Uh... replace the HERE file in the example I have given with your file of
    usernameasswords ??

  10. Re: useradd


    "Chris Cox" escreveu na mensagem
    news:13g56m6ooo3g7f1@corp.supernews.com...
    > Miguel Lopes wrote:
    >> "Chris Cox" escreveu na mensagem
    >> news:13g2pbpiqovbfa1@corp.supernews.com...

    > ...
    >>>> If I do passwd teste and give it the same passwd teste it works fine!!!
    >>> man chpasswd
    >>>
    >>> You can specify the password in encrypted or unecrypted form..
    >>>
    >>> /usr/sbin/chpasswd < >>> teste:teste
    >>> EOF
    >>>

    > ....
    >> my problem is that i'm building a mail server and there are already
    >> around
    >> 100 people in the organization. If I have to do manually, input all the
    >> users and all the password that is going to be extremely painfull.
    >>
    >> I found a script it does what I want BUT not completly It creates the
    >> same
    >> passwd depending on the name here is the link
    >> http://www.howtoforge.com/user_passw..._a_bash_script
    >>
    >> Can anyone help me how can I create another file only for the password.
    >> and
    >> can be done automatically.
    >>

    >
    >
    > Uh... replace the HERE file in the example I have given with your file of
    > usernameasswords ??


    Thanks Chris I didn´t really understand but I tested it and works fine.



  11. Re: useradd

    Miguel Lopes wrote:
    > "Chris Cox" escreveu na mensagem

    ....
    >> Uh... replace the HERE file in the example I have given with your file of
    >> usernameasswords ??

    >
    > Thanks Chris I didn´t really understand but I tested it and works fine.
    >
    >


    No problem. I sometimes reply too quickly without giving enough info.

+ Reply to Thread