Difference between revisions of "Samba"
(→NT_STATUS_LOGON_FAILURE error) |
|||
Line 5: | Line 5: | ||
<pre> | <pre> | ||
sudo smbpasswd -a system_username | sudo smbpasswd -a system_username | ||
+ | </pre> | ||
+ | |||
+ | == Managing Users == | ||
+ | === Persistent Storage === | ||
+ | The default Ubuntu samba installation uses a tdbsam (Trivial DB for Samba) backend, which stores password information in a binary DB file /var/lib/samba/passdb.tdb. This can be changed by modifying the setting | ||
+ | <pre> | ||
+ | passdb backend = tdbsam | ||
+ | <pre> | ||
+ | Valid options are '''Plain Text''', '''smbpasswd''', '''tdbsam''', '''ldapsam''', '''ldapsam_compat''', '''xmlsam''', '''mysqlsam''' and '''pgsqlsam'''. | ||
+ | |||
+ | === Adding users === | ||
+ | To add a samba password for an existing local user | ||
+ | <pre> | ||
+ | sudo smbpasswd -a local_username | ||
+ | </pre> | ||
+ | If necessary, one or more remote usernames can be mapped to a local username. Firstly, add to '''smb.conf''': | ||
+ | <pre> | ||
+ | username map = /etc/samba/smbusers | ||
+ | </pre> | ||
+ | Then, create a map of entries in '''/etc/samba/smbusers''' containing entries of the form: | ||
+ | <pre> | ||
+ | local_username = remote_username | ||
+ | </pre> | ||
+ | Note, however, that samba usernames are not case sensitive, so entries in '''smbusers''' to simply map case differences are not needed. | ||
+ | |||
+ | === Listing samba users === | ||
+ | <pre> | ||
+ | sudo pdbedit -L | ||
+ | </pre> | ||
+ | |||
+ | == Deleting samba users === | ||
+ | <pre> | ||
+ | sudo smbpasswd -x local_username | ||
+ | </pre> | ||
+ | Note that, when installed, samba creates samba users for all local users. This may not be desirable, in which case they can be removed using the script below. It may be worth keeping the "nobody" account active, for guest users. | ||
+ | <pre> | ||
+ | for user in `sudo pdbedit -L | sed -e 's!:.*!!' | grep -v nobody | <grep -v desiredusers> `; do echo $user; sudo smbpasswd -x $user; done | ||
</pre> | </pre> |
Revision as of 13:32, 25 February 2007
See http://ubuntuguide.org/wiki/Dapper#Samba_Server
Contents
NT_STATUS_LOGON_FAILURE / ERRDOS - ERRnoaccess error
Ensure you've added a valid samba user using (as documented in the ubuntu guide):
sudo smbpasswd -a system_username
Managing Users
Persistent Storage
The default Ubuntu samba installation uses a tdbsam (Trivial DB for Samba) backend, which stores password information in a binary DB file /var/lib/samba/passdb.tdb. This can be changed by modifying the setting
passdb backend = tdbsam <pre> Valid options are '''Plain Text''', '''smbpasswd''', '''tdbsam''', '''ldapsam''', '''ldapsam_compat''', '''xmlsam''', '''mysqlsam''' and '''pgsqlsam'''. === Adding users === To add a samba password for an existing local user <pre> sudo smbpasswd -a local_username
If necessary, one or more remote usernames can be mapped to a local username. Firstly, add to smb.conf:
username map = /etc/samba/smbusers
Then, create a map of entries in /etc/samba/smbusers containing entries of the form:
local_username = remote_username
Note, however, that samba usernames are not case sensitive, so entries in smbusers to simply map case differences are not needed.
Listing samba users
sudo pdbedit -L
Deleting samba users =
sudo smbpasswd -x local_username
Note that, when installed, samba creates samba users for all local users. This may not be desirable, in which case they can be removed using the script below. It may be worth keeping the "nobody" account active, for guest users.
for user in `sudo pdbedit -L | sed -e 's!:.*!!' | grep -v nobody | <grep -v desiredusers> `; do echo $user; sudo smbpasswd -x $user; done