Change user password from SSH

Q'center app, Helpdesk app
Post Reply
petruccimx
New here
Posts: 3
Joined: Tue Jan 19, 2016 4:02 am

Change user password from SSH

Post by petruccimx »

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..!! :D
..
KristianM
Starting out
Posts: 20
Joined: Wed Jul 12, 2017 3:38 am

Re: Change user password from SSH

Post by KristianM »

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.
petruccimx
New here
Posts: 3
Joined: Tue Jan 19, 2016 4:02 am

Re: Change user password from SSH

Post by petruccimx »

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.
Thanks for the tip, now my script works fine!! :mrgreen: :lol:
petruccimx
New here
Posts: 3
Joined: Tue Jan 19, 2016 4:02 am

Re: Change user password from SSH

Post by petruccimx »

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.
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..?

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"
and single command

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"
Post Reply

Return to “NAS Management”