Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Adding new users the easy way
#2

Yeah .. its the easy method by far :)

 



Code:
# useradd -d /home/$1 -m -k /etc/skel -g users -G audio,video -s /bin/bash $1




 

That's what I use, please note this isn't perfect for all systems, some might not have the groups I add.

 

Also when I'm setting up accounts (multiple) I normally use the -p option to allow me to set a default password.

 



Code:
# crypt.pl somewonderfulpassword
eBX9jzU8Bjlmo
# useradd -p eBX9jzU8Bjlmo ...... etc .... $1




 

The crypt.pl is a nice simple bit of perl:



Code:
#!/usr/bin/perl -l
$password = shift;
@salt = ('.', '/', 0 .. 9, 'A' .. 'Z', 'a' .. 'z');
print crypt $password, join '', (@salt)[rand 64, rand 64];




 

;)

Reply


Messages In This Thread
Adding new users the easy way - by Dean Plude - 2007-03-20, 12:05 AM
Adding new users the easy way - by znx - 2007-03-20, 10:27 PM
Adding new users the easy way - by Dean Plude - 2007-03-21, 02:15 AM
Adding new users the easy way - by xDamox - 2007-03-21, 04:59 PM
Adding new users the easy way - by znx - 2007-03-21, 07:58 PM
Adding new users the easy way - by xDamox - 2007-03-21, 08:24 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)