From 34f822e7929f7b2c2284c725e94cc007fc76522f Mon Sep 17 00:00:00 2001 From: cyqsimon <28627918+cyqsimon@users.noreply.github.com> Date: Thu, 13 Jan 2022 21:28:40 +0800 Subject: [PATCH] pdbedit, smbpassword: add page & improve comments (#7545) --- pages/linux/pdbedit.md | 21 +++++++++++++++++++++ pages/linux/smbpasswd.md | 15 ++++++++------- 2 files changed, 29 insertions(+), 7 deletions(-) create mode 100644 pages/linux/pdbedit.md diff --git a/pages/linux/pdbedit.md b/pages/linux/pdbedit.md new file mode 100644 index 000000000..eb888467b --- /dev/null +++ b/pages/linux/pdbedit.md @@ -0,0 +1,21 @@ +# pdbedit + +> Edit the Samba user database. +> For simple user add/remove/password, you can also use `smbpasswd`. +> More information: . + +- List all Samba users (use verbose flag to show their settings): + +`sudo pdbedit --list --verbose` + +- Add an existing Unix user to Samba (will prompt for password): + +`sudo pdbedit --user {{username}} --create` + +- Remove a Samba user: + +`sudo pdbedit --user {{username}} --delete` + +- Reset a Samba user's failed password counter: + +`sudo pdbedit --user {{username}} --bad-password-count-reset` diff --git a/pages/linux/smbpasswd.md b/pages/linux/smbpasswd.md index ceb6503e7..e1412e5ca 100644 --- a/pages/linux/smbpasswd.md +++ b/pages/linux/smbpasswd.md @@ -1,20 +1,21 @@ # smbpasswd -> Change a user's SMB password. -> Samba users must also have a local Unix account. +> Add/remove a Samba user or change its password. +> Samba users must have an existing local Unix account. +> More information: . - Change the current user's SMB password: `smbpasswd` -- Add a specified user to Samba and set password(user should already exist in system): +- Add a specified user to Samba and set password (user should already exist in system): -`smbpasswd -a {{username}}` +`sudo smbpasswd -a {{username}}` - Modify an existing Samba user's password: -`smbpasswd {{username}}` +`sudo smbpasswd {{username}}` -- Delete a Samba user: +- Delete a Samba user (use `pdbedit` instead if the Unix account has been deleted): -`smbpasswd -x {{username}}` +`sudo smbpasswd -x {{username}}`