[erlang-questions] scp subsystem

Stefan Jahn stefan@REDACTED
Wed Mar 20 00:03:21 CET 2013


Hello,

after some experiments I ended up with a working file transfer from
standard scp command to my erlang scp daemon.

Thank you for the hint with ssh_cli option.

Now, I have a question about the connection / channel within the
ssh_channel messages (handle_ssh_msg).  How do I get the user login
name from this scope?

Thank you in advance,
  Stefan.

On Tue, March 19, 2013 4:38 pm, Attila Rajmund Nohl wrote:
> Hello!
>
> You can add the subsystem options, they are orthogonal to the cli
> option. I'm not sure about the shell though, at least in our
> implementation the shell option was omitted.
>
> 2013/3/19 Stefan Jahn <stefan@REDACTED>:
>> Hello,
>>
>> it sounds like you have some experiences on that area.
>>
>> You were successfully implementing it using the ssh_cli option
>> of ssh:daemon(), yes?
>>
>> I'll give it a try if anything happening in the module
>> code when hooking it into ssh_cli.
>>
>> I can leave out shell option, as well as subsystems?
>>
>> Can I add e.g. {subsystems, [ssh_sftp:subsystem_spec([])]}} having
>> the sftp server in parallel?
>>
>> Thank you,
>>   Stefan.
>>
>> On Tue, March 19, 2013 3:49 pm, Attila Rajmund Nohl wrote:
>>> 2013/3/19 Stefan Jahn <stefan@REDACTED>:
>>>> Hello,
>>>>
>>>> this means,  one should use
>>>>
>>>> ssh:daemon(..., ..., [
>>>>   {shell, {Module, Function, Args}},
>>>>   ...])
>>>>
>>>> instead of
>>>> ssh:daemon(..., ..., [
>>>>   {subsystems, [subsystem_spec()]},
>>>>   ...])
>>>>
>>>> correct?
>>>
>>> No, unfortunately this is the one that won't work due to the group
>>> swallowing the \000 characters. You should use
>>>
>>> ssh:daemon(..., ..., [
>>>       {ssh_cli,{..., ...}},
>>>         ...])
>>>
>>> and your callback module has to implement the ssh_channel behaviour.
>>>
>>> [...]
>>>> So, it will be impossible to implement it using the shell API?
>>>
>>> I think yes, we've never managed to get it work using the shell API.





More information about the erlang-questions mailing list