I believe the command your looking for is pdbedit.

From the man page "pdbedit - manage the SAM database (Database of Samba Users)"

sudo pdbedit -L -v

-L to list users. -v to be verbose.

Answer from James T on Stack Exchange

I believe the command your looking for is pdbedit.

From the man page "pdbedit - manage the SAM database (Database of Samba Users)"

sudo pdbedit -L -v

-L to list users. -v to be verbose.

Answer from James T on Stack Exchange
Top answer
1 of 2
7

If you login to the Samba server, you can run the following command to list valid Samba users:

sudo pdbedit -L -v

The above command will list users known to Samba - this is not the same as the users and passwords known the Linux server it is running on. Read that last sentence again.

If you don't know the passwords for the old users, you have a couple of choices:

  • change the password of an old, existing user to something new, or
  • add a new user with a new password that you can use.

I think the first option is less desirable because it means if there are clients that know the old password and you change it, they will suddenly stop working.

So, I would add a new Samba user. This new user must have a login name on the Samba server, so either choose an existing Linux username you want to use, or add a new one. Here's a way to add a user called samba:

  • add samba as a regular user with a regular Linux login
  • add samba as a Samba user
  • set the Samba password for samba
  • use those credentials when mounting a Samba share

That looks like:

sudo adduser samba         # add a regular Linux user 
sudo smbpasswd -a samba    # add Samba user called `samba`
sudo smbpasswd -e samba    # enable - may not be needed

Now you should be able to mount the shares with username=samba and the password you just set.

2 of 2
3

Do not give the user 'nobody' a Samba password. The user 'nobody' is used with 'map to guest = bad user' in the global section of smb.conf and with 'guest ok = yes' in a share. If these are set, then Samba will map any unknown users to the guest user and all files created on the share will belong to nobody:nogroup.

If you need to create a new user, you must first create a Linux user and then make that user a Samba user with 'smbpasswd -a username' run as root, where 'username' is the name of the Linux user you just created.

๐ŸŒ
Samba
samba.org โ€บ samba โ€บ docs โ€บ using_samba โ€บ ch09.html
Chapter 9. Users and Security
Let's start out as simply as possible and add support for a single user. The easiest way to set up a client user is to create a Unix account (and home directory) for that individual on the server and notify Samba of the user's existence. You can do the latter by creating a disk share that maps ...
๐ŸŒ
nixCraft
cyberciti.biz โ€บ nixcraft โ€บ howto โ€บ centos โ€บ samba add a user
Samba Add a User - nixCraft
May 25, 2014 - The command is as follows for adding users into Samba Active Directory: # /usr/local/samba/bin/samba-tool user add USERNAME-HERE OR # samba-tool user add USERNAME-HERE Please see Samba AD DC howto for more info.
๐ŸŒ
openSUSE Forums
forums.opensuse.org โ€บ english โ€บ network/internet
samba users and passwords. Where are they? how authentication works? - Network/Internet - openSUSE Forums
August 23, 2017 - After an upgrade to 42.3 Iโ€™m having some issues with samba users I have an user named โ€œfernandoโ€ that is not listed in samba users list but who can access through samba from a Win10 machine I have other user โ€œmariaโ€ listed in the samba database but who canโ€™t โ€ฆ but I can access with user maria from another Opensuse 42.3 machine using smb://aldebaran from dolphin aldebaran:/home/fernando # pdbedit -L Unknown parameter encountered: "printer admin" Ignoring unknown parameter "printer admin" roo...
Find elsewhere
๐ŸŒ
ArchWiki
wiki.archlinux.org โ€บ title โ€บ Samba
Samba - ArchWiki
May 26, 2026 - Change the log file location to a writable path: log file = /var/log/samba/%m.log ยท Change logging to a non-file backend solution: logging = syslog with syslog only = yes, or use logging = systemd ยท If required; the workgroup specified in the [global] section has to match the Windows workgroup (default WORKGROUP). The example configuration file exposes the user's home directory to the network with write access.
๐ŸŒ
OneUptime
oneuptime.com โ€บ home โ€บ blog โ€บ how to configure samba user authentication and permissions on rhel
How to Configure Samba User Authentication and Permissions on RHEL
March 4, 2026 - [projects] path = /srv/samba/projects browseable = yes # Allow these users/groups valid users = @samba_readonly @samba_writers @samba_admins # Read-only for readonly users, write access for writers and admins read list = @samba_readonly write list = @samba_writers @samba_admins admin users = @samba_admins
๐ŸŒ
Webmin
webmin.com โ€บ documentation โ€บ samba windows file sharing
Samba Windows File Sharing | Webmin
May 28, 2023 - The Samba server uses the standard Unix user database to validate clients, although actual Unix passwords cannot be used (for reasons explained later). When a client logs in to a Samba server, it accesses files with the permissions of the Unix user that it authenticated as - just as an FTP ...
๐ŸŒ
SambaWiki
wiki.samba.org โ€บ index.php โ€บ Setting_up_Samba_as_a_Standalone_Server
Setting up Samba as a Standalone Server - SambaWiki
Samba can be configured to automatically create linux user accounts after successful samba authentication, using the [global] add user script smb.conf option. Unfortunately this option does not work as intended at end-user access time, but it can be leveraged to simplify adding users to your samba Standalone Server.
๐ŸŒ
Raspberry Pi Forums
forums.raspberrypi.com โ€บ board index โ€บ using the raspberry pi โ€บ troubleshooting
Configuring a new user for samba - Raspberry Pi Forums
Windows is different, with NTFS you still have 'owner' and 'group' but instead of 'others' you have ACES, or to put it another way, you can give multiple users and groups different access. You will need to have the 'acl', 'xattr' and ntfs-3g packages installed on the Linux (I take it your Plex machine is running Linux) machine Add these lines to your smb.conf file: vfs objects = acl_xattr map acl inherit = Yes store dos attributes = Yes Add a share for the USB drive, it only needs to be something like this: [SHARENAME} path = /path/to/where/you/mounted/the/usbdrive read only = No Restart Samba Now, provided your windows users exist as Samba users with the same password , they should be able to connect to the Share with the same permissions you set on windows.
๐ŸŒ
Ubuntu
ubuntu.com โ€บ tutorials โ€บ install-and-configure-samba
Install and Configure Samba | Ubuntu
A Samba file server enables file sharing across different operating systems over a network. It lets you access your desktop files from a laptop and share files with Windows and macOS users.
๐ŸŒ
Raspberry Pi Forums
forums.raspberrypi.com โ€บ board index โ€บ using the raspberry pi โ€บ advanced users
create samba user with password all in one command - Raspberry Pi Forums
August 10, 2022 - Thu Aug 11, 2022 9:17 pm I managed to work it out so here it is and it may be of benefit to others. creating a user and samba password can be done with a bash script thus: ... #!/bin/bash # create the user useradd -d /home/<username> -s /bin/bash -p $(echo <password> | openssl passwd -1 -stdin) <username> # give user samba password pass=<password> (echo "$pass"; echo "$pass") | smbpasswd -s -a $(echo <username>) exit 0 replace <username> with the name of the user and <password> with your real password Is there a reason you chose to hard code things like that?
๐ŸŒ
Reddit
reddit.com โ€บ r/linuxquestions โ€บ trouble with samba users
r/linuxquestions on Reddit: Trouble with Samba users
February 16, 2025 -

HI I'm wondering if someone can help me out and walk me through my struggles. I've recently embarked on setting up an Ubuntu server in my house. My main goal is centralized spot to save files / pictures etc. But before I can do any of that I seem to have hit wall in creating user profiles. I installed Samba and attempted to set up profiles for it but I can't seem to get past just one. And the only login that use is myusername@myservername login. I set up new users on the server using adduser -a then gave them smbpasswd -a smbpasswd -e and added them to the etc/samba/smb.conf file. I've also tried samba-tool user add USERNAME to add the user to Samba. But whenever I tried to log in with anyone other than my default server profile (from another laptop) I'm unable to get access. Using the default server profile I can connect remotely and access the shared folder create / add / delete etc.

If anyone can eli5 what I'm doing wrong or walk me through this, it would be greatly appreciated.

Thanks in advance for reading.

๐ŸŒ
Hosting Ultra So
hostingultraso.com โ€บ help โ€บ ubuntu โ€บ adding-users-samba-server-ubuntu
Adding users to Samba server on Ubuntu | Ubuntu Server | HostingUltraso.com
To enable multiple users to access a shared resource, you can specify the list of users under the valid users line, as follows: ... Samba also supports the sharing of users, home directories. This will enable users to create shares for all existing Ubuntu users with a single block of configuration.
๐ŸŒ
FreeKB
freekb.net โ€บ Article
List Samba users using the pdbedit command
October 25, 2021 - smbclient --list //$(hostname -s)/share --user john.doe
๐ŸŒ
Narkive
webadmin-list.narkive.com โ€บ qeQkPvWY โ€บ webmin-l-adding-samba-users
[webmin-l] Adding SAMBA users
Unfortunately samba users cannot exist in isolation. Or simpler still, click on the "Configure automatic Unix and Samba user synchronisation" icon to setup automatic samba user creation when a unix user is added. Then you can add a user at System -> Users and Groups, and he will be created ...