Koozali.org: home of the SME Server
Legacy Forums => General Discussion (Legacy) => Topic started by: Soren on November 25, 2002, 01:20:09 AM
-
I want to add a new user, just like the ones I can create in the server-manager - but I want to do it from the shell.
How do I do that?
-
use the command "adduser"
-
Bob Todd: Are you sure that will add the user just as if he was addes using the server manager with mail account, home dir etc?
-
Adduser will only add a unix user.
Jeroen
-
Alright then. How do I create a new e-mail account from the shell?
-
Hi,
Please note that the Mitel SME server has it's own mechnism to create and manage user accounts. If you do this on your own e.g. the 'linux' way on the console, you'll miss important features for this account and might even break correct system-updates/upgrades.
If you would like to use the console (or lack a browser), i think the easiest way would be logging in as admin and start the lynx based server manager via the console menu.
Regards,
guestHH
-
RequestedDeletion: I want to be able to create a new user account from a php page, and I thereby thought an easy way could be to use the php funcktion, that can call shell commands.
Therefore I need to be able to create a useraccount/mail account from the shell
Other suggestions?
-
Soren wrote:
>
> RequestedDeletion: I want to be able to create a new user account
> from a php page, and I thereby thought an easy way could be
> to use the php funcktion, that can call shell commands.
> Therefore I need to be able to create a useraccount/mail
> account from the shell
PHP doesn't run as root, so cannot create useraccounts.
My suggestion - give up and use the web interface which already exists.
Charlie
-
...and if you're dead set on doing it from the shell, Darrell May has a script which will do the job.
-
Dan Brown:
That sounds interesting, But who's Darrell and do you think I could have a look at his script?
Charlie. I might just write a little C program that runs as root and let the program take care of the shell calls. I guess...
I appreciate all you comments and ideas :o)
Regards Soren
-
Darrell's script (along with a HOWTO) can be viewed at
http://myezserver.com/downloads/mitel/howto/addusers-howto.html
It's designed for adding multiple users at a time, but could probably be tweaked to do a single user.
Another script can be found in this thread:
http://forums.contribs.org/index.php?topic=13588.msg51588#msg51588
Again, intended for multiple users, but should do the trick.
-
Great. I'm almost there. I'm using bits of Darrell's script. Just one question... I see the script is using a random number as Uid and Gid.
What happens if an exsiting Uid = the random number?. I guess an error will occur and the user will not be created. Is there an alternative method to generate a Uid/Gid that doesn't exist in the system?
/Soren