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.
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.
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.
In Samba 4 and later, if yours is an AD server, there's also samba-tool user list and other useful user management commands.
For Workgroup or NT4 domain Samba servers, pbdedit -L -v as above.
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
sambaas a regular user with a regular Linux login - add
sambaas 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.
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.
Videos
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.
Have a look at this guide, it is a little bit old but the core concept amd functioality still applies, it may give you a better idea and undestanding about user creation, permissions and sharing directories in general
https://www.digitalocean.com/community/tutorials/how-to-set-up-a-samba-share-for-a-small-organization-on-ubuntu-16-04
hope it helps! :)
Im a bit confused about what you mean with "profiles", in the context of "I installed Samba and attempted to set up profiles for it" and "server profile"....i guess you mean shares. A share can be a profile, but that is more relevant to the client that mounts it.
But from what i read i think you forgot to create the local users with the same login you are trying to give access to. Maybe simply creating the users with useradd -r <username> and adding them to the appropriate groups through usermod -aG <group> <username> that correspond with the permissions on the share and at file level you would see it'd work. But maybe if you are just looking to share some folders with multiple users, openmediavault is a better option, it has a nice webinterface and can expose folders through different means like nfs, smb/ciifs, ssh(sftp), etc. Especially the part you seem to struggle with here is made trivial through the webinterface.