Good Day, I have a question.
We have 150 users, and every month we need change users passwords, I wrote a bash script for change the users passwords, the script works fine but when the user try to access from a windows explorer or smb on mac and linux, he only can access with the old password. But on the web file explorer he can acces with the new password...
If i change the password from web administration panel the user can acces immediately with the new password. But i can't change 150 passwords user's manually every month .
What service or services need to restart. Or what command can use for that.
I use on my bash script the command "passwd user"
Greetings And thank's for any help..!!
..
Change user password from SSH
-
- Starting out
- Posts: 20
- Joined: Wed Jul 12, 2017 3:38 am
Re: Change user password from SSH
You need to change Samba password using smbpasswd. I found it here: /mnt/ext/opt/samba/bin/smbpasswd.
Try "/mnt/ext/opt/samba/bin/smbpasswd -?" - you need -s to pipe std-input into command.
Try "/mnt/ext/opt/samba/bin/smbpasswd -?" - you need -s to pipe std-input into command.
-
- New here
- Posts: 3
- Joined: Tue Jan 19, 2016 4:02 am
Re: Change user password from SSH
Thanks for the tip, now my script works fine!!KristianM wrote:You need to change Samba password using smbpasswd. I found it here: /mnt/ext/opt/samba/bin/smbpasswd.
Try "/mnt/ext/opt/samba/bin/smbpasswd -?" - you need -s to pipe std-input into command.
-
- New here
- Posts: 3
- Joined: Tue Jan 19, 2016 4:02 am
Re: Change user password from SSH
The command is no longer working. It worked only one or two times with a single user, there is some other way to make these password changes..?KristianM wrote:You need to change Samba password using smbpasswd. I found it here: /mnt/ext/opt/samba/bin/smbpasswd.
Try "/mnt/ext/opt/samba/bin/smbpasswd -?" - you need -s to pipe std-input into command.
This is part of the bash script
Code: Select all
send "/mnt/ext/opt/samba/bin/smbpasswd -a $user1\r"
expect "New SMB password:"
send "$pswd1\r"
expect "Retype new SMB password:"
send "$pswd1\r"
Code: Select all
send "/mnt/ext/opt/samba/bin/smbpasswd $user1\r"
expect "New SMB password:"
send "$pswd1\r"
expect "Retype new SMB password:"
send "$pswd1\r"