-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
request: SFTP with password prompt #448
Comments
Thanks for your interest in restic. At the moment, restic uses the system-provided |
SSHPass might be helpful here to fake the keyboard-interactive mode that is neccessary for letting the ssh client fetch the password. @fd0: But sInce you are vendoring golang.org/x/crypto/ssh anyway, why not use that package and call sftp.NewClient instead of ssh.NewClientPipe? I assume the reason is that OpenSSH is considered to be more mature than golang.org/x/crypto/ssh? Anyway, here is what https://godoc.org/golang.org/x/crypto/ssh#example-Client-Listen lists as an example config := &ssh.ClientConfig{
User: "username",
Auth: []ssh.AuthMethod{
ssh.Password("password"),
},
}
// Dial your ssh server.
conn, err := ssh.Dial("tcp", "localhost:22", config)
if err != nil {
log.Fatalf("unable to connect: %s", err)
}
defer conn.Close() Given that, your call to client, err := sftp.NewClient(conn) |
That's certainly possible, but not yet implemented.
That's one point, but the more important thing is: When the sftp backend was implemented, I did not want to define how users configure all needed parameters for ssh: Port, user, password, key, algorithms, host key verification, etc. In my (personal) setting and the ones of several people I asked, everybody already had ssh configured to access the servers (without using a password), so I figured that it's way easier to just use the existing ssh config and call the I think an option to use the Go ssh implementation is a good idea (so it will work on e.g. Windows without having to install ssh), but this is blocked by having a better configuration framework for the backends (that's in the pipeline right now). |
I agree that setting up all connection parameters in ~/.ssh/config is much nicer. A intermediate workaround for @cocodrino might be to have a test in |
Hi! +1 👍 I need password auth to access my hosters backup storage via sftp :-) Mebus |
Hi guys, I'm using a service which ask for the password and I can't handle the auth using public keys, could be possible than for future releases restic handle sftp with password?...maybe setting the values as a env var or passing as argument?...thanks!.
The text was updated successfully, but these errors were encountered: