Skip to content
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

Filesystem Provider with SSH key-based authentication #516

Open
gian-didom opened this issue Jun 13, 2024 · 1 comment
Open

Filesystem Provider with SSH key-based authentication #516

gian-didom opened this issue Jun 13, 2024 · 1 comment

Comments

@gian-didom
Copy link

Description

Implement key-based SFTP authentication via file system provider, without specifying user:password@host:port/path/to/file, but just user@host:port/path/to/file.

Motivation

I'm trying to extend Apple's pkl-lang project by allowing to load remote resources via SFTP. I'm doing this by adding mina-ssd to the project.

I was able to achieve this by manually isntantiating an SSH client and forwarding the remote requests; however, pal-lang has an already implemented feature that allows to use existing file system providers. As Mina has a filesystem provider, it would integrate really beautifully. However, I don't think it is reasonable to use passwords as variables or plain strings in the .pkl configuration files, so using key-based authentication is preferable.

Alternatives considered

I tried to look into Mina's codebase, but it seems that the user string is validated against the presence of the : character. If the number of parts are different Thant 2, the user is considered invalid and an error is thrown.

Additional context

No response

@dragonknight88
Copy link

dragonknight88 commented Dec 12, 2024

Are you using mina server? If yes, you could implement authenticate() method of org.apache.sshd.server.auth.pubkey.PublickeyAuthenticator youself and enable public key auth by adding it to server init.

server.setPublickeyAuthenticator(publickeyAuthenticator);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants