#!/bin/bash
#if [ $(id -u) -eq 0 ]; then
echo "Enter username"
read user
echo "User password"
read pass
egrep "$user" /etc/passwd >/dev/null
if [ $? -eq 0 ]; then
echo "$user exist"
exit 1
else
pass1=$(perl -e 'print crypt($ARGV[0], "pass")' $pass)
useradd -m -p $pass1 $user
echo "User has added successfully" || echo "failed to add username"
fi
Blog Archive
-
▼
2009
(8)
-
▼
October
(8)
- Sending mails using the command line
- Let us ping range of IPs machine
- Useradd via shell script IN Linux
- To check desire machine status for up or down by I...
- To know Disk space Alert by mail in Linux
- Access Windows shares from the terminal
- Aircel/Airtel GPRS on linux via USB cable/bluetoot...
- To check Linux service is on or off
-
▼
October
(8)