How can I request the SFTP service type from SSH c - WeOnlyDo Discussion board

How can I request the SFTP service type from SSH c (General questions)

by Anca, Sunday, June 22, 2008, 20:08 (5997 days ago)

Hello,

I am using the wodSSH on the client part and wodSSHServer on the server part. On the ServiceRequest event (on server) I always set the ServiceType to stNone (0), because I didn't care the service type requested by the client.
But now, the client needs, at request to send a file to the server. So, on the server part I need to use the SFTP capabilities in order to upload that file. So, in the ServiceRequest event on the server I need to have ServiceType = stSubsystem (3). The server cannot set itself this value because he needs to do the other job too (and that job need the service type to be stNone). So, I need that the client to REQUEST this type of service.
I try to do that by setting on the client part, the Subsystem property of SSH to the SFPT string. But it doesn't work. The value that server ssh receive for the service type is strange (something like 15272820) and not always the same... :(
Please tell me how can I do the client to request the protocol that it need (sometimes SFTP, sometimes stNone).
I think that it's possible, because you say in the SSH Server help that:

ServiceRequest is fired after successful authentication of the user with your server. At this point (but also it is possible later to occur) user will request some service, such as to execute shell or some program on your system, or to start SFTP server (implemented internally by wodSSHD).

I hope you can help me with this.

Anca.

Re: How can I request the SFTP service type from S

by wodDamir, Sunday, June 22, 2008, 21:39 (5997 days ago) @ Anca

Anca,

wodSSH cannot use SFTP, since SFTP is a different protocol that runs on top of SSH. WodSSH is a client component that provides you with shell access thru SSH, Telnet, or RAW protocols.

We do have other components that do support SFTP, like wodFtpDLX and wodSFTP. In that case, or when any other client that supports SFTP connects there, it will automatically request stSubsystem service.

Hope I helped.

Regards,
Damba

Re: How can I request the SFTP service type from S

by Anca, Monday, June 23, 2008, 08:45 (5997 days ago) @ wodDamir

Thanks for the response.
I understand what you mean, that wodSSH does not know about SFTP. And maybe the next question I should put on the SSHServer part of forum, but I think that maybe you can responde me here:

why the SSHServer does not receive, in the ServiceRequest event, the correct service type when I try to connect to it trought a SFTP client (WinSCP with SFTP protocol)? If that would work, I still can use the SSHServer and a client SFTP on the client part. I wouldn't have to buy the SFTP component too in order to do that, no?

Anca.

Re: How can I request the SFTP service type from S

by woddrazen, Monday, June 23, 2008, 10:41 (5997 days ago) @ Anca

Hi Anca,


I have just check winSCP and it worked without issues with wodSSHerver. stSubsystem type of ServiceType is received in ServiceRequest Event.

Most probably you are using instead SFTP, SCP in winSCP. Please try disabling SCP in winSCP and try again.

wodSSHServer is compatible with many SFTP client. So you don't need to purchase client component from us to get it work.

Drazen

Re: How can I request the SFTP service type from S

by Anca, Tuesday, June 24, 2008, 08:02 (5996 days ago) @ woddrazen

Yes, you are right. The WinSCP send correctly the ServiceType (to stSubstsystem). I did some mistake in my code...

Thanks for your answer.

Anca.

Hi Anca,


I have just check winSCP and it worked without issues with wodSSHerver. stSubsystem type of ServiceType is received in ServiceRequest Event.

Most probably you are using instead SFTP, SCP in winSCP. Please try disabling SCP in winSCP and try again.

wodSSHServer is compatible with many SFTP client. So you don't need to purchase client component from us to get it work.

Drazen