To add new users to the Linux shell using the commands "adduser" and "useradd", which is then entered into the wizard asking for additional parameters. However, sometimes it is necessary that the user is added automatically, which will be forwarded only username and password parameters, without any wizard. So automatically add users!
Script that works the thing looks like this:
#!/bin/bash
username=$1
password=$2
pass=$(perl -e ‘print crypt($ARGV[0], “password”)’ $password)
useradd -m -p $pass $username
usage:
$. /script username password
Very simple and very useful thing ...
Script for adding users automatically
Started by
Mikorist
, Mar 13 2009 07:56 PM
No replies to this topic
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users