Koozali.org: home of the SME Server

add user via ssh

Ray

add user via ssh
« on: December 31, 2002, 12:01:28 AM »
Is there a way that I can add a user through ssh that would have the identical outcome as adding them through /server-manager?

Abe Loveless

Re: add user via ssh
« Reply #1 on: December 31, 2002, 12:07:19 AM »
A couple ways:

1. This how-to will show you how to open a PPTP tunnel through PuTTY and let you open your server-manager remotely.  This way, it's just like sitting on your local network.
http://myezserver.com/downloads/mitel/howto/putty-howto.html

2. Once you've PuTTY'd in to the server wwitch to the "admin" user "su - admin" and you can access the text-based version of the server-manager from the menu.

3. This howto will let you add multiple users from the command line... can also be used for 1 user.
http://www.tech-geeks.org/contrib/loveless/batch_users/

4. There is also a command that you could execute directly from the command line to add one user, but I can't think of it off the top of my head.  If that's what you want, let me know and I'll look for it.

Hope that helps.

Ray

Re: add user via ssh
« Reply #2 on: December 31, 2002, 12:22:33 AM »
Yes, I'm looking for the command to add one user.  

Thank you very much!

Ray

Re: add user via ssh
« Reply #3 on: December 31, 2002, 12:34:08 AM »
As an alternative, is there a way I could punch up the /server-manager url and include the admin logon and user information so it will populate all of the user information thus automating the data entry into the form?

Abe Loveless

Re: add user via ssh
« Reply #4 on: December 31, 2002, 12:43:23 AM »
In order to have it automatically set the password, we modified the adduser script from the e-smith original script for my batch-users contrib.

So, follow the link in the message above to install the batch-user script.  Once done, here is the command to add an individual user w/password to the system.

echo USERNAME:PASSWORD:FIRSTNAME:LASTNAME | /path/to/adduser

Where "/path/to/adduser" is the path to the "adduser" script, which should be "/opt/utilities/batch_users/adduser"

Let me know how you get along.

Abe

raymondh

Re: add user via ssh
« Reply #5 on: December 31, 2002, 04:46:54 AM »
Cool, it worked perfect!  Since I'm one that is never satisfied :-> is there something similar that will lock and/or remove a user?

Abe Loveless

Re: add user via ssh
« Reply #6 on: December 31, 2002, 05:36:44 PM »
Well, now that you have the batch-users installed, you can use the same method for removing users.

echo USERNAME | /opt/utilities/batch_users/deluser

As for locking the account, I'm afraid I don't have any magic for that.  :)

Let me know how you get along.

Rick

Re: add user via ssh
« Reply #7 on: December 31, 2002, 06:08:57 PM »
have a look at this how to also

http://www.carrollweb.net/putty/putty-howto.html

it will allow you to use ssh yet have full access to the familiar server manager pages

Ray

Re: add user via ssh
« Reply #8 on: December 31, 2002, 08:22:21 PM »
What I'm trying to do is use a windows based program called OptiGold to add users to my e-smith server.  It can do this a number of ways such as, http, ssh, and telnet.

Ideally, I would find a way to do something like "http://myserver.com/add_user/name?=foo:password?=bar"

Abe Loveless

Re: add user via ssh
« Reply #9 on: December 31, 2002, 08:57:16 PM »
That's probably a security hole through http, if unsecured.  Can your program handle an authentication response?