New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sftp server set custom root path #509
Comments
It looks like we have not yet released a new version including this option but: #498 should do what you’re looking for. |
Is #498 merged to master? I am also wanting to provide a landing path for an sftp client. I was looking for a function that provided the ability to run 'sftp-server -d [myLandingPath]' |
Hi, #498 is included in v1.13.5 |
I am confused as to how to use sftp.NewRequestServer() with InMemHandler()
and WithStartDirectory(). Is there an example?
I need to implement an sftp-server which will set the starting directory
(aka landing path) to be an absolute path which is user configurable. The
problem I'm seeing is that although an sftp client can connect and it
appears that it changes to the /var/tmp directory which is I've configured
in my program, the client cannot see read, put, or see any files in that
directory but I know it does exist and is accessible.
server := sftp.NewRequestServer(
channel,
sftp.InMemHandler(),
sftp.WithStartDirectory("/var/tmp"))
Authenticated to 168.25.25.2 ([168.25.25.2]:2022).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: pledge: network
debug1: Sending environment.
debug1: Sending env LANG = en_US.UTF-8
debug1: Sending subsystem: sftp
debug1: client_input_channel_req: channel 0 rtype cd /var/tmp reply 1
Connected to 168.25.25.2.
sftp> pwd
Remote working directory: /var/tmp
sftp> ls
*remote readdir("/var/tmp"): No such file or directory*
sftp>
…On Thu, Sep 22, 2022 at 12:17 PM Nicola Murino ***@***.***> wrote:
Closed #509 <#509> as completed.
—
Reply to this email directly, view it on GitHub
<#509 (comment)>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AKLATV2UVIE3PPA57LWOBMTV7SBB7ANCNFSM5XHFHWQA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Using the Again, the client thinking it is in the In order to use this properly, you need to ensure that the |
Hello, exist some kind of function to set to each client the own root folder access?
like: user1 -> /home/user1, usern -> /home/usern
The text was updated successfully, but these errors were encountered: