|
|
|
|
Configuration: red hat
Salut, j'arrive à faire un script qui change un mot de passe
passwd --stdin essai <<PASSWD test PASSWD mais lorsque je l'intégre dans mon script général j'ai une erreur ./test.sh: line 24: syntax error: unexpected end of file la ligne 24 est la fin du script. Sans cette partie le script fonctionne parfaitement #!/bin/sh IFS=" " USER=`cat $1` for i in $USER; do wUSER=`echo $i | cut -d : -f 1` wUID=`echo $i | cut -d : -f 3` if [ $wUID -gt 10000 ]; then useradd -n -u $wUID -g users -m -k /etc/skel -s /bin/bash $wUSER passwd --stdin $wUSER <<PASSWD test PASSWD fi done pouvez vous m'aider? merci. |
echo user:motdepasse | chpasswd
le tout exécuté en tant que root, ça devrait faire l'affaire, normalement. |