remotefs SSH
About remotefs-ssh ☁️
remotefs-ssh is a client implementation for remotefs, providing support for the SFTP/SCP protocol.
Get started 🚀
First of all, add remotefs-ssh
to your project dependencies:
= "0.3"
= "^0.7"
[!NOTE] The library supports multiple ssh backends. Currently
libssh2
andlibssh
are supported.By default the library is using
libssh2
.
Available backends
Each backend can be set as a feature in your Cargo.toml
. Multiple backends can be enabled at the same time.
libssh2
: The default backend, using thelibssh2
library for SSH connections.libssh
: An alternative backend, using thelibssh
library for SSH connections.
Each backend can be built with the vendored version, using the vendored feature instead:
libssh2-vendored
: Build thelibssh2
backend with the vendored version of the library.libssh-vendored
: Build thelibssh
backend with the vendored version of the library.
If the vendored feature is NOT provided, you will need to have the corresponding system libraries installed on your machine.
[!NOTE] If you need SftpFs to be
Sync
YOU MUST use libssh2.
Other features
these features are supported:
find
: enablefind()
method on client (enabled by default)no-log
: disable logging. By default, this library will log via thelog
crate.
Ssh client
Here is a basic usage example, with the Sftp
client, which is very similiar to the Scp
client.
Both the SftpFs
and ScpFs
constructors are respectively SftpFs::libssh2
and SftpFs::libssh
accordingly to the enabled backends.
// import remotefs trait and client
use RemoteFs;
use ;
use Path;
let opts = new
.port
.username
.password
.config_file;
let mut client = libssh2;
// connect
assert!;
// get working directory
println!;
// change working directory
assert!;
// disconnect
assert!;
Client compatibility table ✔️
The following table states the compatibility for the client client and the remote file system trait method.
Note: connect()
, disconnect()
and is_connected()
MUST always be supported, and are so omitted in the table.
Client/Method | Scp | Sftp |
---|---|---|
append_file | No | Yes |
append | No | Yes |
change_dir | Yes | Yes |
copy | Yes | Yes |
create_dir | Yes | Yes |
create_file | Yes | Yes |
create | Yes | Yes |
exec | Yes | Yes |
exists | Yes | Yes |
list_dir | Yes | Yes |
mov | Yes | Yes |
open_file | Yes | Yes |
open | Yes | Yes |
pwd | Yes | Yes |
remove_dir_all | Yes | Yes |
remove_dir | Yes | Yes |
remove_file | Yes | Yes |
setstat | Yes | Yes |
stat | Yes | Yes |
symlink | Yes | Yes |
Support the developer ☕
If you like remotefs-ssh and you're grateful for the work I've done, please consider a little donation 🥳
You can make a donation with one of these platforms:
Contributing and issues 🤝🏻
Contributions, bug reports, new features, and questions are welcome! 😉 If you have any questions or concerns, or you want to suggest a new feature, or you want just want to improve remotefs, feel free to open an issue or a PR.
Please follow our contributing guidelines
Changelog ⏳
View remotefs-ssh changelog HERE
Powered by 💪
remotefs-ssh is powered by these aweseome projects:
License 📃
remotefs-ssh is licensed under the MIT license.
You can read the entire license HERE