LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Fedora (https://www.linuxquestions.org/questions/fedora-35/)
-   -   add several users - fedora C4 (https://www.linuxquestions.org/questions/fedora-35/add-several-users-fedora-c4-412260/)

xchido 02-06-2006 11:15 AM

add several users - fedora C4
 
I have a fedora core 4 with squirrelmail.

Is there a way to add several users so they can use ftp and squirrelmail (webmail) or do I have to add one by one.

Also, I am looking for a nicer GUI for the squirrelmail webmail user interface.

Any help will be greatly appreciated

HelaWann 02-07-2006 08:41 AM

This depends on the number of users you want to add. If there are 10 - 20 users, the "by hand" sollution ist acceptable. Everything above would need a script and a "database" (csv-file).

Code:

username;password in clear-text;homedir;Mailaddress;all other things you need
For a pure-ftpd with ab puredb-database for user authentication it will fit. This will be no a fine thing, but if you only use it for one time, you could use a script like this:

Code:

#!/bin/bash

for row in `cat <csv-file>`
do
  NAME=`echo $row | cut -f1 -d";"`
  # Do here anything you need
  pure-pw useradd $NAME -d $HOMEDIR -g $GID -u $UID -m << EOF
$PASSWORD
$PASSWORD
EOF
  if [ "$?" -eq 0 ]
  then
    echo "User $NAME addes successfully."
  else
    echo "Error adding user $NAME."
  fi
done

I do not know your webmail-programm to add users, but this should work fine.

Hope this helps!

Hela


All times are GMT -5. The time now is 06:50 PM.