Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 20
Hi people, i'm in need of serious help asap in regard of creating multiple user account like for example of 100 user account using loops in a script to create. ...
  1. #1
    Just Joined!
    Join Date
    May 2007
    Posts
    11

    How to create multiple user accounts using loops in scripts for suse linux

    Hi people, i'm in need of serious help asap in regard of creating multiple user account like for example of 100 user account using loops in a script to create. Can anyone help me asap. Thanks.

  2. #2
    Linux Newbie
    Join Date
    Apr 2007
    Posts
    117
    Quote Originally Posted by b3ckham88 View Post
    Hi people, i'm in need of serious help asap in regard of creating multiple user account like for example of 100 user account using loops in a script to create. Can anyone help me asap. Thanks.
    for i in `seq 1 100`;
    do
    useradd user$i
    done
    There you are
    Ubuntu 8.04 [32bit] @ Gateway MX6453 Notebook

  3. #3
    Just Joined!
    Join Date
    May 2007
    Posts
    11
    sorry, i'm totally new to suse linux, actually basically i have not much idea of where i should put the above code at, can u give me a more detailed idea, i'll appreciate it alot if you could like teach me more about it. Thanks alot

  4. #4
    Linux Newbie
    Join Date
    Apr 2007
    Posts
    117
    1. Copy all the above code with "Ctrl+C"
    2. Open the terminal window and execute "su" then enter the root password
    3. Then press "Shift+Ins" in order to paste the copied code
    4. Wait ......
    5. That's it, the script will create for you 100 accounts.
    Ubuntu 8.04 [32bit] @ Gateway MX6453 Notebook

  5. #5
    Just Joined!
    Join Date
    May 2007
    Posts
    11
    oh thanks alot i will be trying in a moments time, but i still got some query, what would the username be, because the command donesnt have any names e.g. "user0" to "user99", how would the username turn out to be?and aftermath of everything then i set the password is it ?

  6. #6
    Linux Newbie
    Join Date
    Apr 2007
    Posts
    117
    Quote Originally Posted by gatekeeper View Post
    There you are
    Where it says "useradd user$i" the "user$i" part means to create user1, user2, user3 etc.
    Ubuntu 8.04 [32bit] @ Gateway MX6453 Notebook

  7. #7
    Just Joined!
    Join Date
    May 2007
    Posts
    11
    for i in `seq 1 100`;
    do
    useradd user$i

    i get an error

    -bash: syntax error near unexpected token 'seq 1 100';
    firstly i can get to paste in from this forum into the VMWARE
    then afterwards i get that error, wat's wrong with it.
    sorry if i ask too much but i need help haha.thanks

  8. #8
    Linux Newbie
    Join Date
    Apr 2007
    Posts
    117
    Quote Originally Posted by b3ckham88 View Post
    for i in `seq 1 100`;
    do
    useradd user$i

    i get an error

    -bash: syntax error near unexpected token 'seq 1 100';
    firstly i can get to paste in from this forum into the VMWARE
    then afterwards i get that error, wat's wrong with it.
    sorry if i ask too much but i need help haha.thanks
    I am in windows now trying to recover some deleted files which will take some hours. Be patient once i log into back to linux, or if someone else help you out.
    Ubuntu 8.04 [32bit] @ Gateway MX6453 Notebook

  9. #9
    Just Joined!
    Join Date
    May 2007
    Posts
    11
    kk, i'll be waiting to hear an reply from you. Thanks alot.

  10. #10
    Just Joined!
    Join Date
    May 2007
    Posts
    11
    right now i having a problem which is that when i type all the code in, i having tis error message which says "mkdir: '/home/student/Documents/user' exists but it is not a directory
    useradd:User 'user99' already exists", i do see all the users in my /etc/passwd but just that what actually the error message is trying to meant ?

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...