[erlang-questions] scp subsystem

Attila Rajmund Nohl <>
Tue Mar 19 15:16:18 CET 2013


2013/3/19 Ingela Andin <>:
[...]
> 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.



More information about the erlang-questions mailing list