sftp server does not accept pubkey auth #1411
Labels
No Label
0.2.0
0.3.0
0.4.0
0.5.0
0.5.1
0.6.0
0.6.1
0.7.0
0.8.0
0.9.0
1.0.0
1.1.0
1.10.0
1.10.1
1.10.2
1.10a2
1.11.0
1.12.0
1.12.1
1.13.0
1.14.0
1.15.0
1.15.1
1.2.0
1.3.0
1.4.1
1.5.0
1.6.0
1.6.1
1.7.0
1.7.1
1.7β
1.8.0
1.8.1
1.8.2
1.8.3
1.8β
1.9.0
1.9.0-s3branch
1.9.0a1
1.9.0a2
1.9.0b1
1.9.1
1.9.2
1.9.2a1
LeastAuthority.com automation
blocker
cannot reproduce
cloud-branch
code
code-dirnodes
code-encoding
code-frontend
code-frontend-cli
code-frontend-ftp-sftp
code-frontend-magic-folder
code-frontend-web
code-mutable
code-network
code-nodeadmin
code-peerselection
code-storage
contrib
critical
defect
dev-infrastructure
documentation
duplicate
enhancement
fixed
invalid
major
minor
n/a
normal
operational
packaging
somebody else's problem
supercritical
task
trivial
unknown
was already fixed
website
wontfix
worksforme
No Milestone
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Reference: tahoe-lafs/trac-2024-07-25#1411
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The docs suggest that one can put a public key in the ftp accounts file, but the same docs file says this is not yet implemented. Having to configure and enter a password makes it harder to do a full fuse mount automatically.
This is related to #1353.
: is the sftp server gonna support pubkey auth any time soon?
: tarcieri: patches welcome :)
: to be honest, I forget how large or small a project that one is
: I suspect that twisted conch does support client pubkey auth, we're just not exposing that
: yeah, I vaguely remember it being in there, just a bit hard to reach
: so, convince us this is a really useful thing to add (shouldn't be hard since we hate passwords)
Looks like the easy half is done:
frontends/auth.py
parses the pubkey lines from the account file and stashes them in the right place.The hard half will involve code from
twisted/conch/checkers.py
, probably fromSSHPublicKeyDatabase._cbRequestAvatarId
, specifically this bit:plus some code to make sure we're using the right key for the requested username.
Yes, it does look easy. There's a full example at http://www.devshed.com/c/a/Python/SSH-with-Twisted/2/. (I don't know why that example has the server knowing the client's private key. It doesn't need it; that's the whole point of public key auth! I think you can just omit the
sshFactory.privateKeys = ...
line.)Attachment sftp-auth-key-1411.patch (3859 bytes) added
sftp-auth-key-1411.patch contains diff for src/allmydata/frontends/auth.py and enables to setup several keys each with it's own rootcap.
Needs test before further review.
I am trying to test this and it's not working for me. I have my private/accounts file with the following
and have setup the .ssh/config on my client to be
Every time I use "ssh tahoe" I get a login failure. Without the "PasswordAuthentication no" I'll be asked to enter a password. Is there something else that I need to configure first?
Found the issue. Line 61 in auth.py needs to be "credentials.username" not just "username". This is now working on my machine.
exarkun posted a pull request: https://github.com/tahoe-lafs/tahoe-lafs/pull/134
Will review at Nuts and Bolts today.
+1 modulo https://github.com/exarkun/tahoe-lafs/commit/38aee94a3eb3c007cc6cb1d7cb5b04b66f5d8f99#commitcomment-9172496
Fixed in 5 patches ending with [6c756ba3e9f32804802ce1a0c0835db5483f3ad2/trunk].
Documentation added in [0d935e858964b646c4ccbca5b2a1c0be97addf34/trunk].
Filed #2359 to add integration tests.