checksum on server with ftp

English support forum

Moderators: Hacker, petermad, Stefan2, white

richardhcoctopus
Junior Member
Junior Member
Posts: 12
Joined: 2012-05-17, 08:07 UTC
Location: Noumea, New Caledonia
Contact:

checksum on server with ftp

Post by *richardhcoctopus »

Is it possible for Total Commander to get a checksum for a file on a server via ftp?
I tried but got a message "not supported"
I wondered if the new version 8 could do it.
User avatar
Flint
Power Member
Power Member
Posts: 3511
Joined: 2003-10-27, 09:25 UTC
Location: Belgrade, Serbia
Contact:

Post by *Flint »

richardhcoctopus
It is impossible to count checksums without reading the whole contents of a file. Therefore it requires either downloading the file and counting its checksum locally, or making the server count the file checksum for you. So there is nothing TC is able or will be able to do.

If your server supports corresponding commands (like XMD5 or XSHA1) you can send them from TC command line and see the results. If not — there is no other way but to download the file and calculate its checksum locally, as usual.
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
 
Using TC 11.03 / Win10 x64
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50934
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

TC 7.5x supports XMD5 and XSHA1 when using "synchronize dirs", but only if the server reports to support these commands. They are used to compare local and remote files. TC doesn't show them (except in log), but uses them to show whether a local and a remote file are the same or not.
Author of Total Commander
https://www.ghisler.com
Sob
Power Member
Power Member
Posts: 945
Joined: 2005-01-19, 17:33 UTC

Post by *Sob »

Don't forget XCRC, the most often available of them all.

Simply check the beginning of ftp log and look at the FEAT command reply. If any of XCRC, XMD5, XSHA1 or HASH is listed, it's possible to use them to get checksums from server. You just have to manually send them to server, TC won't currently help you with that outside of Synchronize Dirs. On the other hand, it's not too hard, just type the command and Ctrl+Enter on selected file will put the whole name to command line, so it's usable if you don't need to do it too often.

Perhaps future TC could be extended so that Create Checksum File(s) command would work also for FTP (if supported by server). Probably a little differently, e.g. just show the result(s) in the same window as the result of manual command. Not perfect, but still much better than "Function not supported!" message box.
richardhcoctopus
Junior Member
Junior Member
Posts: 12
Joined: 2012-05-17, 08:07 UTC
Location: Noumea, New Caledonia
Contact:

Post by *richardhcoctopus »

I was able to get the checksum from the server using pUTTY and the command md5sum
This only works when connected with SFTP
I have some large (500MB+) programs that I sell online in a protected folder that has a total of about 1200 files and the folder is not duplicated on my local computer so I using Synchronize Dirs is not very satisfactory to just check and see if a big file I uploaded actually got there OK.
I'll try the command line - If I understand correctly the command line is kind of like using Telnet to send a command.
User avatar
Hacker
Moderator
Moderator
Posts: 13144
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

richardhcoctopus,
I'll try the command line - If I understand correctly the command line is kind of like using Telnet to send a command.
Not really. The command line just lets you send commands to the FTP server. In turn, the FTP server may understand the "SITE <command>" command and thus be instructed to run this command. Have fun exploring! :)

HTH
Roman
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.
richardhcoctopus
Junior Member
Junior Member
Posts: 12
Joined: 2012-05-17, 08:07 UTC
Location: Noumea, New Caledonia
Contact:

Post by *richardhcoctopus »

I ran into a problem when trying to connect with SFTP
After connecting I get:
Get directory
TYPE A
200 TYPE is now ASCII
PORT XXXXXXXXXXXX
500 I won't open a connection to XXXXXXXXXX (only to YYYYYYYYYYY) -( had to change this to X and Y as the post was not allowed)

Any idea what the problem with the connection is?

Also I don't see any of the XCRC, XMD5, HASH listed after
FEAT
211-Extensions supported:
EPRT
IDLE
MDTM
SIZE
REST STREAM
MLST type*;size*;sizd*;modify*;UNIX.mode*;UNIX.uid*;UNIX.gid*;unique*;
MLSD
AUTH TLS
PBSZ
PROT
ESTA
PASV
EPSV
SPSV
ESTP
211 End.
HELP SITE
214-The following SITE commands are recognized
ALIAS
CHMOD
IDLE
UTIME
214 Pure-FTPd -
PBSZ 0
200 PBSZ=0
PROT P
200 Data protection level set to "private"
OPTS UTF8 ON
504 Unknown command
CWD /public_html
250 OK. Current directory is /public_html
Connect ok!
PWD
257 "/public_html" is your current location
Get directory
TYPE A
200 TYPE is now ASCII
PORT XXXXXXXXXX
500 I won't open a connection to
Sob
Power Member
Power Member
Posts: 945
Joined: 2005-01-19, 17:33 UTC

Post by *Sob »

richardhcoctopus wrote:I ran into a problem when trying to connect with SFTP
SFTP is what you might use with PuTTY, following log is either FTP or FTPS (FTP with SSL). Anyway, this one is easy to solve, just enable passive mode in connection properties.
Also I don't see any of the XCRC, XMD5, HASH listed after FEAT
That's bad news for you, this server does not support remote checksums.
richardhcoctopus
Junior Member
Junior Member
Posts: 12
Joined: 2012-05-17, 08:07 UTC
Location: Noumea, New Caledonia
Contact:

Post by *richardhcoctopus »

Thanks very much Sob. I guess I'm stuck with the PuTTY method. It does work and I don't have to do it very often.

Thanks for the tip on using passive mode.
Sob
Power Member
Power Member
Posts: 945
Joined: 2005-01-19, 17:33 UTC

Post by *Sob »

You can also use SFTP plugin for TC. No huge advantages compared to PuTTY (I mean for working with checksums), it's basically the same, you'd just run md5sum from TC's command line. So just another option, but it's possible that you could like something about it better.
richardhcoctopus
Junior Member
Junior Member
Posts: 12
Joined: 2012-05-17, 08:07 UTC
Location: Noumea, New Caledonia
Contact:

Post by *richardhcoctopus »

I did install SFTP plugin - but when I connect using SSL/TLS checked - and use passive mode checked - I still get that same error message after I connect and it enters passive mode -
227 Entering Passive Mode (69,195,83,119,21,254)
PORT 192,168,1,101,213,129
500 I won't open a connection to 192.168.1.101 (only to 101.101.12.246)
This does not happen with a normal FTP connection. Not sure what is wrong. But I don't think I can use the command line on TC unless I connect with SSL/TLS.
User avatar
Flint
Power Member
Power Member
Posts: 3511
Joined: 2003-10-27, 09:25 UTC
Location: Belgrade, Serbia
Contact:

Post by *Flint »

richardhcoctopus
What you try to do is install the plugin and continue to connect via FTPS completely ignoring the plugin. SFTP is an SSH connection and has nothing to do with usual FTP protocol, while FTPS is normal FTP wrapped into SSL/TLS.

To use the installed SFTP plugin, do not press Ctrl+F: plugins cannot integrate into this window! You need to go to Network Neighborhood and open Secure FTP folder there. But for SFTP to work, the server must allow incoming SSH connections.
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
 
Using TC 11.03 / Win10 x64
Sob
Power Member
Power Member
Posts: 945
Joined: 2005-01-19, 17:33 UTC

Post by *Sob »

With SSL/TLS checked or not, it's still FTP, it does not change available commands (*1). It only enables or disables encrypted connections.

If TC is configured to use passive mode, sends PASV command to server and gets correct reply, but then falls back to active mode (PORT command), it means that it can't establish data connection to server. If it happens only with SSL but works correctly without it, then it looks like server relies on packet inspection to open data ports, which can't work with encrypted connections. In other words, server might be a little misconfigured.

But as Flint wrote, SFTP is something completely different. So try that.

--
(*1) In theory it could, but it's very unlikely.
richardhcoctopus
Junior Member
Junior Member
Posts: 12
Joined: 2012-05-17, 08:07 UTC
Location: Noumea, New Caledonia
Contact:

Post by *richardhcoctopus »

OK, it connects fine from network using the Secure FTP
But after navigating to the folder I selected the file and tried md5sum from the command line - that did generate a hash but it wan't the right one and when I tried another file I got the same hash.
So I put md5sum Filename.exe in the command line - this time it waited about the right amount of time to generate a hash but it just came up with
quote md5sum filename.exe
That's it.
It works OK with PuTTY and comes up with the correct hash.
User avatar
Flint
Power Member
Power Member
Posts: 3511
Joined: 2003-10-27, 09:25 UTC
Location: Belgrade, Serbia
Contact:

Post by *Flint »

richardhcoctopus wrote:But after navigating to the folder I selected the file and tried md5sum from the command line - that did generate a hash but it wan't the right one and when I tried another file I got the same hash.
When you run a command from command line, it's sent to the server and executed there. How in the world is the server supposed to know what you selected in your TC on your client machine? :D It just runs md5sum on an empty input and returns its hash. So, yes, you need to specify file name in the command line too.
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
 
Using TC 11.03 / Win10 x64
Post Reply