Page 1 of 1

sftp stream using keyfile

Posted: 24 Jan 2016 23:36
by Entropy0
I'm looking for a way to open a stream via sftp using a keyfile (as opposed to the usual user:password prompt vlc opens by default), but can't seem to find any documentation about this whatsoever.

I'm tring to do something like

Code: Select all

vlc -i .ssh/key "sftp://user@remote.host/path/to/file/"
I know I could do

Code: Select all

ssh -i .ssh/key user@remote.host "cat /path/to/file" | vlc -
, but that wouldn't enable me to control the stream (beyond play/pause). (Also, it's kind of an ugly solution)
Simply downloading the file also isn't an option, since it isn't a given that recording to file has finished when I start playback.


Any ideas? :/

Re: sftp stream using keyfile

Posted: 25 Jan 2016 01:04
by Rémi Denis-Courmont
Check the libsftp documentation. Not sure if this is possible at all.

Re: sftp stream using keyfile

Posted: 25 Jan 2016 12:25
by Entropy0
I'm not sure where to look for that - "libsftp" doesn't produce any useful results in google whatsoever (and neither does "lib sftp") and "gnome-vfs", which apparently provides the libsftp.so on my system doesn't have a good documentation either.
But even if I was able to find documentation on the underlying library that vlc uses - how would I pass any calls to it? When using the sftp command I could just give the argument -o "IdentityFile=/.ssh/key", which of course isn't a valid option in vlc. Not that I would have to do that when using the sftp command line utility - it correctly uses a key according to ssh_config/ keys added via ssh-add/ defaults to .ssh/id_protocol.
So, yes - it should be possible in general - whether vlc supports this however seems questionable at this point :/

Re: sftp stream using keyfile

Posted: 25 Jan 2016 14:38
by Rémi Denis-Courmont
Sorry, that's libssh2.

Re: sftp stream using keyfile

Posted: 02 Feb 2016 18:39
by Entropy0
Well, I can't figure out how to do this (or if it is indeed possible at all), but I found a solution for my usecase: sshfs. Just mount the remote directory with sshfs using the keyfile and voila - vlc can open the remote files as local via fuse.