NAME
Rex::Interface::Fs::LibSSH - Rex filesystem operations via exec channels (no SFTP)
VERSION
version 0.003
DESCRIPTION
Rex::Interface::Fs::LibSSH implements Rex's filesystem interface using SSH exec channels instead of SFTP. Every operation runs a small shell command on the remote host via Net::LibSSH.
This makes it suitable for servers that have no SFTP subsystem — minimal containers, embedded systems, or any host where set connection => 'OpenSSH' would crash with Can't call method "stat" on an undefined value.
LIMITATIONS
This class does not route filesystem operations through Rex::Interface::Fs::Sudo. _run hardcodes Rex::Interface::Exec->create('LibSSH') rather than letting create() resolve via "get_connection_type" in Rex::Interface::Connection::LibSSH, so operations reached from inside this class never get the Sudo wrap that get_connection_type would normally select under Rex::is_sudo. This is a known limitation, not a bug: switching to the resolving form would change behaviour for every existing caller. Callers that need sudo-wrapped filesystem operations should use Rex::Interface::Fs::Sudo explicitly.
upload and download slurp the entire file into memory on both ends before sending or returning. This is fine for config files but not appropriate for large files. A future implementation could stream through Net::LibSSH::Channel::read with an explicit length — read(undef) reads zero bytes, so callers that pass through an optional $len must default to slurping rather than passing it through unchanged.
SEE ALSO
Rex::Interface::Connection::LibSSH, Rex::Interface::File::LibSSH
SUPPORT
Issues
Please report bugs and feature requests on GitHub at https://github.com/Getty/rex-libssh/issues.
CONTRIBUTING
Contributions are welcome! Please fork the repository and submit a pull request.
AUTHOR
Torsten Raudssus <getty@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2026 by Torsten Raudssus <torsten@raudssus.de> https://raudssus.de/.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.