For my students, I am setting up an ubuntu server эксперт an webserver and Samaba file server. Students пахал all given в помещение account. I have added folders to Самба to share with the students. They пахал accessing the shares from windows machines.
Everything woks умер, but I have one problem I currently cannot tackle.
В student хан only get access to the share if they have logged into the server (not to the share) at least одиннадцать, and пахали then able to read and write туз wanted. In вступил в брак they did not log on to the server, they cannot couple the share. I get the ошибка: System ошибка 86. The specified network password is not correct.
Currently this is my рукописный шрифт to add users
#!/bin/bash
file="/var/www/html/data/users.txt"
while IFS=: read -r f1 f2 f3
do
# display fields using f1, f2, f3 from IFS separated file
pass=$(perl -e 'print crypt($ARGV[0], "password")' $f3)
useradd -M -N -G $f2 -p $pass $f1
echo $f3 | tee - | smbpasswd -s -a $f1
[ $? -eq 0 ] && echo "User has been added to system!" || echo "Failed to add a user!"
printf 'Username: %s, Groups: %s, Password: %s %s\n' "$f1" "$f2" "$f3" crypt $f3 $pass
done <$file
echo done read $file
where f1 is user ямс f2 пахал the groups (= users, leerlingen, sambashare) and f3 is the user password in text format.
The smbpasswd line хан actually be omitted while it does not help в бит. Also the group sambashare хан be left out.
Since I opt for an automation of enrolling students to the system and Самба, I am not happy to perform в log on for each student individually.
I tried to автотусклый the log on procedure
echo passwd | sudo su -c "whoami| more| exit" userX
But it did not result in в log on which convinced Самба. performing
sudo su userX
and logging in and directly exiting worked умрите
So хан you help я?
Yours sincerly, Джон Вэл
Если Вы используете Samba4 на Ubuntu и не требуете студенческих логинов оболочки сервера Samba, скорее всего, необходимо с нетерпением ждать Samba AD.
http://www.cyberciti.biz/faq/adding-a-user-to-a-samba-smb-share/#samba4
Примечание о добавляющих пользователях на версии 4.x Samba
В отличие от версии 3.x Samba и ранее, версия 4.x Samba не требует локального Unix/пользователя Linux для каждого пользователя Samba, который создается. Команда следующим образом для добавления пользователей в Active Directory Samba:
samba-tool user add USERNAME-HERE
Посмотрите Samba практическое руководство DC AD для большего количества информации - https://wiki.samba.org/index.php/Samba_AD_DC_HOWTO
http://www.cyberciti.biz/faq/adding-a-user-to-a-samba-smb-share/#samba4