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

Probably shouldn't advertise hardlink@openssh.com extension #889

Closed
jscheid opened this issue Jun 25, 2022 · 8 comments
Closed

Probably shouldn't advertise hardlink@openssh.com extension #889

jscheid opened this issue Jun 25, 2022 · 8 comments

Comments

@jscheid
Copy link

jscheid commented Jun 25, 2022

Hi, sftpgo advertises the hardlink@openssh.com extension. But when I try to use it, I'm getting an "operation unsupported" error back. Perhaps there is a reason for the discrepancy?

@drakkan
Copy link
Owner

drakkan commented Jun 25, 2022

SFTPGo only advertises statvfs@openssh.com

debug2: Server supports extension "statvfs@openssh.com" revision 2

maybe you have this issue because you are using SFTPGo as OpenSSH subsystem and in this case is OpenSSH that advertises extensions

@jscheid
Copy link
Author

jscheid commented Jun 25, 2022

$ (printf '\x00\x00\x00\x05\x01\0x00\x00\x00\x06' && cat) | sftpgo startsubsys 2>/dev/null | hexdump -C
00000000  00 00 00 5f 02 00 00 00  03 00 00 00 14 68 61 72  |..._.........har|
00000010  64 6c 69 6e 6b 40 6f 70  65 6e 73 73 68 2e 63 6f  |dlink@openssh.co|
00000020  6d 00 00 00 01 31 00 00  00 18 70 6f 73 69 78 2d  |m....1....posix-|
00000030  72 65 6e 61 6d 65 40 6f  70 65 6e 73 73 68 2e 63  |rename@openssh.c|
00000040  6f 6d 00 00 00 01 31 00  00 00 13 73 74 61 74 76  |om....1....statv|
00000050  66 73 40 6f 70 65 6e 73  73 68 2e 63 6f 6d 00 00  |fs@openssh.com..|
^C
$ sftpgo --version
SFTPGo 2.3.1-ca4da2f-2022-06-10T17:11:30Z +metrics +azblob +gcs +s3 +bolt +mysql +pgsql +sqlite +portable
$ 

@jscheid
Copy link
Author

jscheid commented Jun 25, 2022

Wait, are you saying the command above runs OpenSSH?

@drakkan
Copy link
Owner

drakkan commented Jun 25, 2022

Wait, are you saying the command above runs OpenSSH?

no. SFTPGo is not OpenSSH.

Can you reproduce the problem if you run SFTPGo in non-subsystem mode? I think in subsystem mode the extensions are not set, but in this mode the extensions are probably advertised by OpenSSH. I'll do some tests the next week or when I have some free time

@jscheid
Copy link
Author

jscheid commented Jun 25, 2022

If it doesn't run OpenSSH, how can OpenSSH be involved? Like you can see in my example, I'm running sftpgo directly.

I'll try running in non-subsystem mode next.

@drakkan
Copy link
Owner

drakkan commented Jun 25, 2022

If it doesn't run OpenSSH, how can OpenSSH be involved? Like you can see in my example, I'm running sftpgo directly.

I'll try running in non-subsystem mode next.

because you connect to OpenSSH and not to SFTPGo and probably OpenSSH does not ask for extensions to the sftp subsystem (I'm not sure). However setting the supported extensions in subsystem mode is just a one line change. I'm not sure this will fix your issue

@drakkan
Copy link
Owner

drakkan commented Jun 25, 2022

Now you have this

(printf '\x00\x00\x00\x05\x01\0x00\x00\x00\x06' && cat) | ./sftpgo startsubsys 2>/dev/null | hexdump -C
00000000  00 00 00 21 02 00 00 00  03 00 00 00 13 73 74 61  |...!.........sta|
00000010  74 76 66 73 40 6f 70 65  6e 73 73 68 2e 63 6f 6d  |tvfs@openssh.com|

@jscheid
Copy link
Author

jscheid commented Jun 25, 2022

Awesome, thanks!

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