Register
It is currently Tue Jul 22, 2014 3:33 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: 94
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 http://www.debian-administration.org/articles/47)

I'd also like to incorporate this http://www.howtoforge.com/chroot_ssh_sftp_debian_etch so each user is automatically jailed to their homedir

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

Any help would be greatly appriciated


Top
 Profile  
 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' (http://linux.die.net/man/1/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:
Code:
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


Top
 Profile  
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: Google [Bot] and 11 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:  
cron


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP