|
SftpItem objects provide the owner and group name and IDs, but I do not see a way to check if this applies to the current user except by remembering what name I supplied to Login(). Is it possible using Rebex's SFTP component to retrieve the current user's name, id, and a list of groups the user belongs to? |
|
SFTP protocol itself doesn't make it possible to retrieve this information from the server, but it runs over SSH. If the logged-in user has permission to execute shell commands over SSH and if the server uses a Unix-like OS, you can use SSH's remote exec capability to determine the information needed. First, you need the following method (C#):
You can then use this method with an instance of
If you prefer VB.NET, please let me know. This worked perfectly (though I implemented it as an extension method instead), thanks!
(28 May '10, 14:49)
Bill W
|