rust-smb-server
SMB server in Rust.
Install
Or in Cargo.toml:
[]
= "0.4"
Run the example
Listens on 0.0.0.0:4445. Override with SMB_LISTEN and SMB_ROOT.
Shares: public (anon rw), media (anon ro), home (alice rw, bob ro).
Embed
use ;
let server = builder
.listen
.user
.share
.build?;
server.bind.await?;
server.serve.await?;
Runtime config
Create a ConfigHandle before serve() and keep it in the task that owns admin/config updates:
use ;
let server = builder
.listen
.share
.build?;
let config = server.config_handle;
config.add_user.await?;
let home = new
.user;
config
.add_share
.await?;
config.revoke_share_user.await?;
config.remove_user.await?;
server.serve.await?;
Removing a user revokes that user's active sessions. Removing a share or revoking share access closes matching active tree connections and open handles.
License
MIT.