Samba on Ubuntu

List Samba users?

Commands

smbstatus Report on current Samba connections
pdbedit Manage the SAM database (Database of Samba Users)
smbpasswd Add user resp. change a user’s SMB password
net Tool for administration of Samba and remote CIFS servers
getent Get entries from Name Service Switch libraries (nsswitch.conf)
smbd Server to provide SMB/CIFS services to clients
nmbd NetBIOS name server to provide NetBIOS over IP naming services to clients
samba Server to provide AD and SMB/CIFS services to clients
samba-tool Main Samba administration tool
smbclient FTP-like client to access SMB/CIFS resources on servers

smbstatus

Explanation of smbstatus output

net

$ net rpc share list
print$
download
share
IPC$

$ net rpc user
andreas

Restart

$ service smbd restart
$ service nmbd restart

Authorization

How to debug Samba authorization (authentication) procedure

$ smbcontrol smbd debuglevel
PID 4603: all:0 tdb:0 printdrivers:0 lanman:0 smb:0 rpc_parse:0 rpc_srv:0 rpc_cli:0 passdb:0 sam:0 auth:0 winbind:0 vfs:0 idmap:0 quota:0 acls:0 locking:0 msdfs:0 dmapi:0 registry:0 scavenger:0 dns:0 ldb:0 tevent:0

$ smbcontrol smbd debug 10

$ smbcontrol smbd debuglevel
PID 4603: all:10 tdb:10 printdrivers:10 lanman:10 smb:10 rpc_parse:10 rpc_srv:10 rpc_cli:10 passdb:10 sam:10 auth:10 winbind:10 vfs:10 idmap:10 quota:10 acls:10 locking:10 msdfs:10 dmapi:10 registry:10 scavenger:10 dns:10 ldb:10 tevent:10
[2017/01/23 10:33:51.995263,  3] ../source3/auth/auth.c:178(auth_check_ntlm_password)
  check_ntlm_password:  Checking password for unmapped user [DESKTOP-TJAKC58]\[andreas]@[DESKTOP-TJAKC58] with the new password interface
[2017/01/23 10:33:51.995280,  3] ../source3/auth/auth.c:181(auth_check_ntlm_password)
  check_ntlm_password:  mapped user is: [NAS]\[andreas]@[DESKTOP-TJAKC58]
[2017/01/23 10:33:51.995472,  3] ../source3/passdb/lookup_sid.c:1645(get_primary_group_sid)
  Forcing Primary Group to 'Domain Users' for andreas
[2017/01/23 10:33:51.995729,  3] ../source3/auth/auth.c:249(auth_check_ntlm_password)
  check_ntlm_password: sam authentication for user [andreas] succeeded
[2017/01/23 10:33:51.998567,  2] ../source3/auth/auth.c:305(auth_check_ntlm_password)
  check_ntlm_password:  authentication for user [andreas] -> [andreas] -> [andreas] succeeded

Leave a Reply

Your email address will not be published. Required fields are marked *

smbstatus -p listing of samba processes
smbstatus -S listing of shares that are currently being accessed
smbstatus -L file locking status for the files that are being accessed