Closed alexey-sderzhikov closed 1 year ago
Unfortunately, I don’t think there is any way to lookup usernames and groupnames from the remote service. 🤔 You’re going to have to go off of the longname
information in this case. But I’m not sure we surface that information up.
We’d like to be able to provide more of this data, but we really have rework a lot of the way the package works. We started some of that work with the internal/ssh/filexfer/
package, but I haven’t managed to complete even the client update. But in some ways, we almost need a new API entirely, so…
The interface you’re referencing is how one can define a way for a RequestServer
to provide usernames and groupnames for clients when it’s generating the longname
field of the SSH_FXP_NAME_ATTR
without having to use the system’s username/groupname mappings.
Thanks for your answer!
Okey, maybe i can call a shell command via ssh
to find out metadata which i need with your package?
I would expect you could download the /etc/passwd
file which would provide a mapping for you. But you’d have to self-decode it all.
Yeah, i can find username it this way! But /etc/passwd
consist only username info, how i can find groupname?
For groupnames those are in /etc/groups
Thanks for your help. Can i help with features which we are talked above?
I’m not sure there is a generic sort of way to work around this stuff. So, I appreciate the offer, but I think this is a problem which we must fundamentally leave to the reader.
Hi!
I need to get file's username and groupname with sftp, how i can do this? I found interface with useful methods for my goals:
But i couldnt find any struct which implements this interface. How i need handle with this interface, or exist another ways to get file's username and groupname? Thanks for answers!