Sorry for later answer..
crypt() is a C function for encrpyt data for use to passwd,login vs commands..
I suppose for work to crypt() must be include some headers and some librarys.Instead of easy way use to openssl or php or perl..
Actually your problem is already solved..
And additional m1xram informations
i can try to a basic script only diffrence from you i am preference manually give password to users..
#!/bin/bash
usernamex="$1"
#read -p "Please to create a username " usernamex -- if you manuel entry for username
echo "user $1 for password ... "
read -sre passwordx
echo "password setting up ... "
echo ""
sleep 2
function salt ()
{
characterset="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz./"
saltkeylength=8 #it is random character length give what you want to which length
local i
i=0
while [ $i -ne "$saltkeylength" ]
do
let indis=$RANDOM%${#characterset}
saltkey+="${characterset:$indis:1}"
let i+=1
done
}
salt ""
echo "md5 hashing password is get...ok!"
sleep 2
userpasswordx=`openssl passwd -1 -salt $saltkey $passwordx`
#openssl passwd -1 $passwordx -- if you encrypt password without saltkey
useradd -p $userpasswordx $usernamex
# and can add your error control code
if [ $? -eq 0 ]
then
echo "User $usernamex successfully added...ok!"
else
echo "Problem adding $usernamex"
fi
root@rhnserver include]# ./useraddx.sh testuser
user testuser for password ...
password setting up ...
md5 hashing password is get...ok!
User testuser successfully added...ok!
[root@rhnserver include]# cat /etc/shadow | grep testuser
testuser:$1$Kl$SLUJfKKAMALM5fDPFXweR0:14695:0:99999:7:::
And for kerberos authentication first you install samba and winbind services packages..
and configure your /etc/samba.conf
add to realm option
for example
realm=yourdomain.com
and then you must start the samba service..
and test your pdc connection controller
nmblookup yourdc1
if test is ok you can join the domain
smbpasswd �j yourdomain.com yourdc1 �U administrator
/etc/nsswitch.conf is your say so for example
passwd: files winbind
shadow: files winbind
group: files winbind
hosts: files dns winbind
bootparams: files
ethers: files
protocols: files winbind
services: files winbind
netgroup: files winbind
publickey: files
automount: files winbind
after you must start winbind service..
after than you can test to try view domain users list
wbinfo �u
and you can make a directory for domain users
mkdir /home/YOURDOMAIN
and pam authentication is must be setup
I m very clearly for details but my conf files il below
� /etc/pam.d/login �
***************************************************
auth required pam_securetty.so
auth required pam_stack.so service=system-auth
auth required pam_nologin.so
account required pam_stack.so service=system-auth
password required pam_stack.so service=system-auth
session required pam_selinux.so close
session required pam_stack.so service=system-auth
session required pam_loginuid.so
session optional pam_console.so
session required pam_selinux.so open
� /etc/pam.d//system-auth �
***************************************************
#%PAM-1.0
# This file is auto-generated.
# User changes will be destroyed the next time authconfig is run.
auth required /lib/security/pam_env.so
auth sufficient /lib/security/pam_winbind.so
auth sufficient /lib/security/pam_unix.so likeauth nullok use_first_pass
auth required /lib/security/pam_deny.so
account required /lib/security/pam_unix.so
account sufficient /lib/security/pam_succeed_if.so uid < 100 quiet
account required /lib/security/pam_permit.so
password requisite /lib/security/pam_cracklib.so retry=3
password sufficient /lib/security/pam_unix.so nullok use_authtok md5 shadow
password required /lib/security/pam_deny.so
session required /lib/security/pam_limits.so
session required /lib/security/pam_unix.so
session required /lib/security/pam_mkhomedir.so skel=/etc/skel umask=0022
***************************************************
So you can explore on google i m sure you can find a lot of details and documents..
Regards
Yucel Gemici @ygemici