How to get IP of the client in the upload/download event?

0 votes
asked Jan 15 by allison (170 points)
edited Jan 15 by allison

Hi all,

We are planning to set up a SCP server and needs to get the client IP when it uploads/downloads files.

It seems that the upload/download evens of the FileServer do not provide the information of the client IPs. In our environment multi clients from different machines can only share the same user name / password to connect to the server (for management reason).

Any workaround to get the client IP? This is a critical requirement for our usage, any help appreciated.


1 Answer

0 votes
answered Jan 16 by Lukas Pokorny (82,430 points)
selected Jan 16 by allison
Best answer


The solution proposed in another answer should be suitable for this scenario as well. Please give it a try and let us know if you run into any problems.

To enable SCP in addition to SFTP, you would have to add the following line as well:

server.Bind(22, FileServerProtocol.Scp);
commented Jan 16 by allison (170 points)
Thanks Lukas. This solution does work and solves our problem.