Forced user password change SFTP

Please post here if you have problems in using Wing FTP Server.

Forced user password change SFTP

Postby TeamBas » Wed Sep 15, 2021 9:20 am

Dear WingFTP Team,

Is there an option that can be set to force the user to change their SFTP password!?

Regards
TeamBas
TeamBas
 
8
 
Wed Sep 15, 2021 8:59 am

Re: Forced user password change SFTP

Postby TeamBas » Wed Sep 15, 2021 9:55 am

Dear WingFTP-Team,

Can you help us to create a lua script to Change all user passwords for HTTPS and SFTP

We have more than 2000 users

Regards
TeamBas
TeamBas
 
8
 
Wed Sep 15, 2021 8:59 am

Re: Forced user password change SFTP

Postby FTP » Wed Sep 15, 2021 3:56 pm

You can't change the password in the SFTP client software, SFTP protocol doesn't support such function.

And changing all user passwords for HTTPS/SFTP is possible, so do you want to change all user passwords into the same password?
FTP
Site Admin
 
1863
 
Tue Sep 29, 2009 6:09 am

Re: Forced user password change SFTP

Postby TeamBas » Thu Sep 16, 2021 12:49 pm

No, we only want to force users to change their passwords and no more.

Thx
TeamBas
TeamBas
 
8
 
Wed Sep 15, 2021 8:59 am

Re: Forced user password change SFTP

Postby FTP » Thu Sep 16, 2021 5:08 pm

OK, you can force user change his password, but it is for the web client only, because if you use a FTP/SFTP client software, it can't popup a Change Password form.
FTP
Site Admin
 
1863
 
Tue Sep 29, 2009 6:09 am

Re: Forced user password change SFTP

Postby TeamBas » Fri Sep 17, 2021 6:10 am

Do you have an example of how to force this?

Thx
TeamBas
TeamBas
 
8
 
Wed Sep 15, 2021 8:59 am

Re: Forced user password change SFTP

Postby FTP » Fri Sep 17, 2021 11:08 am

First, please enable the domain option "Domain > Settings > General Settings > Password & Security > Need to change the password on the first logon", also enable the option "Edit user -> General -> User can change their password" for all the user accounts.

And then execute the following Lua script under "Web admin -> Administration -> Console" (replace the string "YourDomainName" into your own domain name):

Code: Select all
local domain = "YourDomainName"
local userlist = Split(c_GetUserList(domain), "\n")
for _,username in pairs(userlist) do
c_ResetUserLoginIP(domain, username)
end
FTP
Site Admin
 
1863
 
Tue Sep 29, 2009 6:09 am

Re: Forced user password change SFTP

Postby TeamBas » Wed Sep 22, 2021 2:03 pm

How can I change this value for all users?
Image

Thx
TeamBas
TeamBas
 
8
 
Wed Sep 15, 2021 8:59 am

Re: Forced user password change SFTP

Postby FTP » Fri Sep 24, 2021 4:55 pm

OK, you can run the following script under "Administration -> Console":

Code: Select all
local domain = "YourDomainName"

local userlist = Split(c_GetUserList(domain), "\n")
for _,username in pairs(userlist) do

local user = c_GetUser(domain, username)
for k,v in pairs(user) do
if type(v) == "boolean" then
if v == true then
user[k] = 1
else
user[k] = 0
end
end
end

user.oldpassword = user.password


user.change_pass = 1
user.pass_length = 14
AddUser(domain, user)

end



BTW, it seems you are using an old version of WingFTP, so you had better upgrade to the latest version 6.6.2 first.
FTP
Site Admin
 
1863
 
Tue Sep 29, 2009 6:09 am

Re: Forced user password change SFTP

Postby TeamBas » Tue Sep 28, 2021 10:54 am

Thanks, Super worked :)

But the first Password script works only for the first user who tries to log in.
All other users are not prompted, maybe you have a solution for this?

Thx
TeamBas
Version 6.5.2
TeamBas
 
8
 
Wed Sep 15, 2021 8:59 am

Next

Return to Support

Who is online

Users browsing this forum: No registered users and 3 guests

cron