veeso
pavao
Rust

A Rust client library for SMB ๐Ÿฆš

Last updated May 5, 2026
81
Stars
14
Forks
4
Issues
0
Stars/day
Attention Score
28
Language breakdown
No language data available.
โ–ธ Files click to expand
README

Pavรฃo

pavao logo

~ A Rust client library for SMB ~

Get started ยท Crates.io ยท Documentation

Developed by @veeso

Current version: 0.2.16 (04/12/2025)

License-MIT Repo stars Downloads counter Latest version Ko-fi

Linux CI MacOS CI Coveralls Docs


- About Pavรฃo ๐Ÿฆš - SMB Rust client for Windows - Get started ๐Ÿ - Add pavao to your Cargo.toml ๐Ÿฆ€ - Install pavao C dependencies on your system ๐Ÿ–ฅ๏ธ (not vendored) - MacOS ๐ŸŽ - Debian based systems ๐Ÿง - RedHat based systems ๐Ÿง - OpenBSD ๐Ÿก - Termux ๐Ÿค– - Build from sources ๐Ÿ“ - Vendored libsmbclient - Create a pavao application - Run examples - Documentation ๐Ÿ“š - Support the developer โ˜• - Contributing and issues ๐Ÿค๐Ÿป - Changelog โณ - License ๐Ÿ“ƒ

About Pavรฃo ๐Ÿฆš

Pavรฃo (/pษ.หˆvษฬƒwฬƒ/) is a Rust client library for SMB version 2 and 3 which exposes type-safe functions to interact with the C libsmbclient.

pavao gif

SMB Rust client for Windows

SMB is natively supported on Windows by the fs module. If you're looking on how to use SMB on Windows with Rust, please check out this article or consider adopting remotefs-smb.


Get started ๐Ÿ

Add pavao to your Cargo.toml ๐Ÿฆ€

pavao = "0.2"

Install pavao C dependencies on your system ๐Ÿ–ฅ๏ธ (not vendored)

MacOS ๐ŸŽ

Install samba with brew:

brew install samba

Debian based systems ๐Ÿง

Install libsmbclient with apt:

apt install -y libsmbclient-dev libsmbclient

โš ๏ธ libsmbclient-dev is required only on the machine where you build the application

RedHat based systems ๐Ÿง

Install libsmbclient with dnf:

dnf install libsmbclient-devel libsmbclient

โš ๏ธ libsmbclient-devel is required only on the machine where you build the application

OpenBSD ๐Ÿก

Install samba with pkg_add:

pkg_add samba

Termux ๐Ÿค–

Install samba with pkg:

pkg install samba

Build from sources ๐Ÿ“

Install libsmbclient building from sources:

wget -O samba.tar.gz https://github.com/samba-team/samba/archive/refs/tags/samba-4.23.0.tar.gz
mkdir -p samba/
tar  xzvf samba.tar.gz -C samba/ --strip-components=1
rm samba.tar.gz
cd samba/
./configure
make
make install
cd ..
rm -rf samba/

Vendored libsmbclient

It is possible to build libsmbclient statically when building pavao.

To do so it is enough to enable the vendored feature for the pavao crate in your Cargo.toml:

pavao = { version = "0.2", features = ["vendored"] }
[!CAUTION]
Mind that libsmbclient is a bloated library with tons of dependencies, so the vendored feature will increase the size of the final binary and may not work on all platforms.

In order to build and run with the vendored feature YOU MUST have the following libraries in your LDLIBRARYPATH:

see DEPENDENCIES


Create a pavao application

use pavao::{SmbClient, SmbCredentials, SmbOptions, SmbOpenOptions};

// Initialize a new client let client = SmbClient::new( SmbCredentials::default() .server(server) .share(share) .password(password) .username(username) .workgroup(workgroup), SmbOptions::default().oneshareper_server(true), ) .unwrap(); // do anything you want here with client let mut file = client.open_with("/abc/test.txt", SmbOpenOptions::default().read(true)).unwrap(); // read file... drop(file); // disconnect from server drop(client);

Run examples

Two examples are provided along with this repository and can be found under the examples/ directory.

The tree example can be used to get a fs tree of the smb share and can be run with:

cargo run --example tree -- -u <username> -w <workspace> -s <share> -P <password> smb://<hostname>

while the transfer example shows how to write a file to the remote host and can be run with:

cargo run --example transfer -- -i <fileonlocal> -o <filetowrite> -u <username> -w <workspace> -s <share> -P <password> smb://<hostname>

Documentation ๐Ÿ“š

The developer documentation can be found on Rust Docs at


Support the developer โ˜•

If you like Pavรฃo 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:

ko-fi PayPal


Contributing and issues ๐Ÿค๐Ÿป

Contributions, bug reports, new features and questions are welcome! ๐Ÿ˜‰ If you have any question or concern, or you want to suggest a new feature, or you want just want to improve pavao, feel free to open an issue or a PR.

Please follow our contributing guidelines


Changelog โณ

View Pavรฃo's changelog HERE


License ๐Ÿ“ƒ

Pavรฃo is licensed under the MIT license.

You can read the entire license HERE

๐Ÿ”— More in this category

ยฉ 2026 GitRepoTrend ยท veeso/pavao ยท Updated daily from GitHub