It is currently Tue Apr 24, 2018 7:05 pm

Multi server user creation

All times are UTC - 6 hours

Post new topic Reply to topic  [ 2 posts ] 
Author Message
 PostPosted: Tue Jul 21, 2009 2:20 pm   

Joined: Fri May 16, 2008 4:58 am
Posts: 95
I'd like a script that wil enable me to add a user to a specified server via ssh ie

Enter server: (I would enter a b c etc which would relate to a specific server ip/hostname)
Enter username:
Enter password:
Enter password again:
Enter quota: (I'd like to enable a hard quota on their homedir using

I'd also like to incorporate this so each user is automatically jailed to their homedir

then some sort of output ie
Server: a
Username: blah
Password: blah
User sucessfully created

Any help would be greatly appriciated

 PostPosted: Tue Sep 01, 2009 6:01 pm   
User avatar

Joined: Sat Jun 13, 2009 8:53 pm
Posts: 73
Location: Texas!
Look at ssh-keygen for easy logins to the servers.

Use useradd and passwd to set up the user account.

Look at 'expect' (, which you will probably need to install, to handle supplying the username and password at the prompt. I'm guessing that it would be nice to supply these as arguments to the script.

To make use of quotas, do everything in that link (by hand, not in the script) up to:
quotatool -u username -bq 200M -l '250 Mb' /home
which you will want to do in the script, with the correct username and sizes.

The chrooted user thing is a bit more involved. I recommend that you complete everything else first.

- thobbs

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 6 hours

Who is online

Users browsing this forum: No registered users and 25 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  

BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group