ekle diye bir dosyaya bunu yapistirip root kullanici ile ./ekle yaz oldu bitti.
#!/bin/bash
if [ $(id -u) -eq 0 ]; then
read -p “Kullaniciadi : “ username
read -s -p “Sifre : “ password
egrep “^$username” /etc/passwd >/dev/null
if [ $? -eq 0 ]; then
echo “$username sistemde kayitli!”
exit 1
else
pass=$(perl -e ‘print crypt($ARGV[0], “password”)’ $password)
useradd -m -p $pass $username
[ $? -eq 0 ] && echo “Kullanici hesabi yaratildi!” || echo “Kullanici hesabi yaratilamadi!”
fi
else
echo “Sadece root kullanici hesabi yaratabilir”
exit 2
fi