[erlang-questions] scp subsystem

Stefan Jahn stefan@REDACTED
Tue Mar 19 15:36:52 CET 2013


Hello,

this means,  one should use

ssh:daemon(..., ..., [
  {shell, {Module, Function, Args}},
  ...])

instead of
ssh:daemon(..., ..., [
  {subsystems, [subsystem_spec()]},
  ...])

correct?

Does "the communication goes through
the group I/O handler and that doesn't handle the 0 (\000) character
well"
mean, that it cannot be handled at all?

So, it will be impossible to implement it using the shell API?

Thank you in advance,
  Stefan.

On Tue, March 19, 2013 3:16 pm, Attila Rajmund Nohl wrote:
> 2013/3/19 Ingela Andin <ingela.andin@REDACTED>:
> [...]
>> ssh_cli is to customize the shell I do not think you want to use
>> ssh_cli at all. You should write your scp-deamon as subsystem and then
>> use an existing scp client to connect to it or
>
> Unfortunately scp does not use a separate subsystem (unlike SFTP). Scp
> uses an EXEC request to start the scp executable on the server side,
> then the client communicates directly with this started process (over
> the SSH channel), see
> https://blogs.oracle.com/janp/entry/how_the_scp_protocol_works
>
> Even more unfortunately one cannot write a simple shell to handle the
> this communication, because by default the communication goes through
> the group I/O handler and that doesn't handle the 0 (\000) character
> well. A whole new channel has to be implemented, along with the logic
> in the scp executable. So the short answer is to use SFTP, if you can.
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>





More information about the erlang-questions mailing list