Creating and Managing the Samba Password File

The Samba server uses its own password file to authenticate users connecting from clients. On SUSE systems this is the file /etc/samba/smbpasswd.

Users that already exist on the system (in /etc/passwd, having their encrypted passwords in /etc/shadow) are not automatically added as Samba users. To add a samba user, you need to use the smbpasswd command, which adds or modifies a user in the file /etc/samba/smbpasswd.

To add a Samba user, run smbpasswd with the - a (add) option:

# smbpasswd -a roger New SMB password: Retype new SMB password: Added user roger.

This adds a line to the /etc/samba/smbpasswd, including an encrypted password.

The user that you are adding to the Samba password file must be a valid Linux user on your system, for whom an entry exists in the standard Linux /etc/passwd file.

If you execute the smbpasswd command without an argument, the command attempts to change the password for the current user. If you specify a username without specifying the -a option, the smbpasswd command attempts to change the Samba password for the specified user.

For complete information about the smbpasswd command, see the online manual page for the command, available by typing man smbpasswd.

Continue reading here: Working with the Winbind Daemon

Was this article helpful?

0 -1

Readers' Questions

  • bisrat hamid
    Which command is used to create a samba user?
    8 months ago
  • The command used to create a Samba user is 'smbpasswd'.