New SFTP plugin available now

Discuss and announce Total Commander plugins, addons and other useful tools here, both their usage and their development.

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48083
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Please put all the DLLs from the libcurl archive to the TC directory. You probably forgot the zlib1.dll. Newer ssh versions depend on it.
Author of Total Commander
https://www.ghisler.com
User avatar
sqa_wizard
Power Member
Power Member
Posts: 3864
Joined: 2003-02-06, 11:41 UTC
Location: Germany

Post by *sqa_wizard »

7.28.1 Win64 versions
This ones are not working for me too!

I have got a working set with:

TC 32-bit (TOTALCMD.EXE) using DLLs of curl-7.28.1-devel-mingw32.zip at <TC installdir> directory
TC 64-bit (TOTALCMD64.EXE) using DLLs of curl-7.27.0-devel-mingw64.7z at <TC installdir>\64 directory
#5767 Personal license
Thieumdesp
Junior Member
Junior Member
Posts: 2
Joined: 2013-02-12, 15:44 UTC

Post by *Thieumdesp »

Hello,

just an information. I a not able to delete existing connexion (Suppr or F8 does not work).

Is there a way to do that ?

Thanks.
--------------
Thieumdesp
User avatar
sqa_wizard
Power Member
Power Member
Posts: 3864
Joined: 2003-02-06, 11:41 UTC
Location: Germany

Post by *sqa_wizard »

Well, try the good old "Del" key to delete ...

Sorry I missed, that "Suppr" IS the "Delete" key on a French keyboard :oops:

"Suppr" and F8 keys should both do the job.

Do you have write permission to your wincmd.ini file?
#5767 Personal license
Thieumdesp
Junior Member
Junior Member
Posts: 2
Joined: 2013-02-12, 15:44 UTC

Post by *Thieumdesp »

OK, found the solution.

In fact, the connection was active, so no way to delete it.
I close and restart total commander, go to "Secure FTP", the connection appears in grey and can be deleted (i tried with F8).

Thanks !
--------------
Thieumdesp
BeckYang
Junior Member
Junior Member
Posts: 29
Joined: 2006-04-02, 10:33 UTC

[SFTP plugin] remind password expired

Post by *BeckYang »

I often connect to a sftp server which ask user change their password every 90 days.
When my password expired, the progress bar of SFTP plugin will go to 90%, back to 80% then repeat. I do not what happened, until connect using another ssh program to verify it...

Here is the data that I connect using another ssh program.
login as: xyz
xyz@?.?.?.?'s password: ********
[files]: 3004-332 Your password has expired.
Last unsuccessful login: Thu Sep 27 10:56:56 TAIST 2012 on ssh from ?.?.?.?
Last login: Mon Feb 4 11:11:32 TAIST 2013 on /dev/pts/1 from ?.?.?.?

WARNING: Your password has expired.
You must change your password now and login again!
Changing password for "xyz"
xyz's Old password:
xyz's New password:
Enter the new password again:
xyz@sserver:/home/xyz>
Could SFTP plugin popup the message WARNING: Your password has expired?
It would be helpful when password expired or account is locked...
User avatar
Hacker
Moderator
Moderator
Posts: 13065
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

[mod]Merged one post from [SFTP plugin] remind password expired.

Hacker (Moderator)[/mod]
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48083
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Unfortunately I don't think that this is possible with OpenSSH.
Author of Total Commander
https://www.ghisler.com
Sob
Power Member
Power Member
Posts: 941
Joined: 2005-01-19, 17:33 UTC

Post by *Sob »

It is possible, see the last parameter: http://www.libssh2.org/libssh2_userauth_password_ex.html
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48083
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Thanks for the info about libssh2_userauth_password_ex - I wasn't aware of this function, I was using libssh2_userauth_password. The problem is how to test this without a server which requests a password change. Would anyone be interested in a test version?
Author of Total Commander
https://www.ghisler.com
Sob
Power Member
Power Member
Posts: 941
Joined: 2005-01-19, 17:33 UTC

Post by *Sob »

On Linux (I assume you have some for testing) you can set account expiration for selected account using chage command. I did quick test with PuTTY and OpenSSH server and it works.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48083
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

OK, I have tried to implement it now, but it doesn't work. When I use SSH, I get this:

Code: Select all

ssh localhost -l testuser
testuser@localhost's password: 
You are required to change your password immediately (password aged)
Welcome to Linux Mint 12 Lisa (GNU/Linux 3.0.0-15-generic i686)

Welcome to Linux Mint
 * Documentation:  http://www.linuxmint.com

WARNING: Your password has expired.
You must change your password now and login again!
Changing password for testuser.
(current) UNIX password: 
However, when I try to connect with my SFTP plugin and call the function
libssh2_userauth_password_ex

it returns with error 0 (success) without calling the callback function. When I then try to create an SFTP connection with libssh2_sftp_init, the function hangs forever with error "would block". Any ideas?

Edit: A new version of the SFTP plugin is available now on http://www.ghisler.com/plugins.htm . Changes:
1. It works now with the current version of the openssh dlls from libcurl. The problem was that the zip dll was renamed from zlibwapi.dll to zlib1.dll
2. Changing the password works when the server supports "keyboard interactive" authentication method, but NOT password authentication
3. The code changing the password with password authentication has been added, but as described above, the callback is never called.
Author of Total Commander
https://www.ghisler.com
Sob
Power Member
Power Member
Posts: 941
Joined: 2005-01-19, 17:33 UTC

Post by *Sob »

You're right, it does not work.

In fact, it does not work with PuTTY either, even though it gives you an option (well, forces you) to change the password. Those prompts don't come from PuTTY nor OpenSSH server. PuTTY does support the required mechanism (SSH_MSG_USERAUTH_PASSWD_CHANGEREQ message in SSH protocol), but OpenSSH looks like it doesn't. There's something in the source, but it seem to be for client part only.

But some other servers should support it: http://www.chiark.greenend.org.uk/~sgtatham/putty/wishlist/ssh2-password-expiry.html
Sob
Power Member
Power Member
Posts: 941
Joined: 2005-01-19, 17:33 UTC

Post by *Sob »

I tried trial version of VShell Server and after one small fix it works great. Too bad it's mostly wasted work, because most commonly used OpenSSH does not support it. :(

Code: Select all

--- sftpplug_src14-clean\sftpfunc.cpp	2013-02-22 12:14:16.000000000 +0100
+++ sftpplug_src14\sftpfunc.cpp	2013-02-23 17:06:45.110054900 +0100
@@ -542,8 +542,9 @@
 	LoadStr(buf1,IDS_PASS_CHANGE_REQUEST);
 	newpass[0]=0;
 	if (RequestProc(PluginNumber,RT_Password,title,buf1,newpass,sizeof(newpass)-1)) {
-		*newpw=newpass;
 		*newpw_len=(int)strlen(newpass);
+		*newpw = (char *)malloc(*newpw_len);
+		strlcpy(*newpw, newpass, *newpw_len);
 		if (PassConnectSettings) {
 			strlcpy(PassConnectSettings->password,newpass,sizeof(PassConnectSettings->password)-1);
 			switch (PassConnectSettings->passSaveMode) {
User avatar
sqa_wizard
Power Member
Power Member
Posts: 3864
Joined: 2003-02-06, 11:41 UTC
Location: Germany

Post by *sqa_wizard »

1. It works now with the current version of the openssh dlls from libcurl.
Nevertheless I can confirm the fix is working even on 64-bit now :D

I have got a working set with:

SFTP plugin 1.4

TC 32-bit (TOTALCMD.EXE) using DLLs of curl-7.29.0-devel-mingw32.zip at <TC installdir> directory
TC 64-bit (TOTALCMD64.EXE) using DLLs of curl-7.29.0-devel-mingw64.7z at <TC installdir>\x64 directory

Thanks a lot !
#5767 Personal license
Post Reply