doc:appunti:linux:tux:samba
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| doc:appunti:linux:tux:samba [2018/02/05 16:20] – [Gestione Avanzata del Dominio con Samba 4] niccolo | doc:appunti:linux:tux:samba [2021/05/19 12:46] (current) – [Problema "Nome di dispositivo locale già in uso" (win => smb)] niccolo | ||
|---|---|---|---|
| Line 158: | Line 158: | ||
| In un dominio NT ogni utente ha un **RID** (relative identifier), | In un dominio NT ogni utente ha un **RID** (relative identifier), | ||
| + | |||
| + | ==== Copia delle password ==== | ||
| + | |||
| + | Se è attiva l' | ||
| + | |||
| ===== Scadenza password ===== | ===== Scadenza password ===== | ||
| Line 252: | Line 257: | ||
| La soluzione è da //Control Panel//, //User Accounts//, // | La soluzione è da //Control Panel//, //User Accounts//, // | ||
| + | |||
| + | ===== Problema "Nome di dispositivo locale già in uso" (win => smb) ===== | ||
| + | |||
| + | Problema con unità disco mappata su risorsa di rete (ad esempio lettera **G:** mappata su **%%\\server\share%%**) in modo permanente, al riavvio di Windows l' | ||
| + | |||
| + | < | ||
| + | Errore durante la riconnessione di G: a \\server\share | ||
| + | Microsoft Windows Network: Nome di dispositivo locale già in uso. | ||
| + | La connessione non è stata ripristinata. | ||
| + | </ | ||
| + | |||
| + | in inglese: | ||
| + | |||
| + | < | ||
| + | An error occurred while reconnecting G: to \\server\share | ||
| + | Microsoft Windows Network: The local device name is already in use. | ||
| + | This connection has not been restored. | ||
| + | </ | ||
| + | |||
| + | FIXME Non si riesce a trovare una soluzione. Una cosa strana: creando un batch che disconnette e riconnette l' | ||
| + | |||
| + | < | ||
| + | net use G: /delete | ||
| + | net use G: \\server\share | ||
| + | </ | ||
| + | |||
| + | ===== Problema smbclient con Windows a dominio (smb => win) ===== | ||
| + | |||
| + | Se un PC Windows è unito a un dominio, le credenziali fornite per accedere ad una risorsa condivisa vengono fatte verificare al controllore del dominio stesso. | ||
| + | |||
| + | Ad esempio con il comando: | ||
| + | |||
| + | < | ||
| + | smbclient -U user%password -L ' | ||
| + | </ | ||
| + | |||
| + | il programma **smbclient** usa come nome di dominio ciò che è indicato dal parametro **workgroup** di **/ | ||
| + | |||
| + | Se si utilizzano le credenziali di un utente locale della WORKSTATION (che non esiste a livello di dominio), il comando fallisce con: | ||
| + | |||
| + | < | ||
| + | session setup failed: NT_STATUS_LOGON_FAILURE | ||
| + | </ | ||
| + | |||
| + | Per risolvere il problema si può indicare esplicitamente sulla riga di comando **smbclient** sia il nome del dominio che l' | ||
| + | |||
| + | < | ||
| + | smbclient -W WORKGROUP -U LOCAL/ | ||
| + | </ | ||
| ===== Lettura/ | ===== Lettura/ | ||
| Line 349: | Line 403: | ||
| addgroup --system domguest | addgroup --system domguest | ||
| - | net groupmap add ntgroup=" | + | net groupmap add ntgroup=" |
| - | net groupmap add ntgroup=" | + | net groupmap add ntgroup=" |
| - | net groupmap add ntgroup=" | + | net groupmap add ntgroup=" |
| </ | </ | ||
| + | |||
| + | Il gruppo **Domain Admins** è speciale e deve avere **RID = 512**. | ||
| Per vedere i gruppi definiti: | Per vedere i gruppi definiti: | ||
| Line 361: | Line 417: | ||
| Domain Admins (S-1-5-21-4236855997-251099150-3575921365-512) -> domadmin | Domain Admins (S-1-5-21-4236855997-251099150-3575921365-512) -> domadmin | ||
| Domain Users (S-1-5-21-4236855997-251099150-3575921365-1023) -> domuser | Domain Users (S-1-5-21-4236855997-251099150-3575921365-1023) -> domuser | ||
| + | </ | ||
| + | |||
| + | Verificare che il SID corrisponda a quello del dominio: | ||
| + | |||
| + | < | ||
| + | net getlocalsid | ||
| + | SID for domain DOMAINNAME is: S-1-5-21-4236855997-251099150-3575921365 | ||
| </ | </ | ||
| Line 371: | Line 434: | ||
| Domain Users | Domain Users | ||
| Domain Guests | Domain Guests | ||
| + | </ | ||
| + | |||
| + | |||
| + | Si può chiedere l' | ||
| + | |||
| + | < | ||
| + | net rpc rights list -U Administrator%password | ||
| + | </ | ||
| + | |||
| + | e assegnare, vedere e revocare un privilegio ad un utente: | ||
| + | |||
| + | < | ||
| + | net rpc rights grant simone SeBackupPrivilege -U Administrator%password | ||
| + | net rpc rights list simone -U Administrator%password | ||
| + | net rpc rights revoke simone SeBackupPrivilege -U Administrator%password | ||
| </ | </ | ||
| Line 387: | Line 465: | ||
| < | < | ||
| pdbedit --fullname=" | pdbedit --fullname=" | ||
| + | </ | ||
| + | |||
| + | ===== Accesso ad uno share Windows 7 smbclient ===== | ||
| + | |||
| + | After a Windows 7 update (which upgraded the operating system to **Windows 7 Professional 7601 Service Pack 1**) a connection from a GNU/Linux host via **smbclient** stopped working: | ||
| + | |||
| + | < | ||
| + | smbclient -L pcwindows7 -U username%password | ||
| + | session setup failed: NT_STATUS_INVALID_HANDLE | ||
| + | </ | ||
| + | |||
| + | asking for debug on the smbclient command line showed the usual, useless data: | ||
| + | |||
| + | < | ||
| + | SPNEGO login failed: Invalid handle | ||
| + | </ | ||
| + | |||
| + | |||
| + | The **Event Viewer** on the sharing host were showing the expected **Logon Type 3 (Network)**, | ||
| + | |||
| + | It turned out theat the user had the **Administrator' | ||
| + | |||
| + | ===== Analisi Log Samba ===== | ||
| + | |||
| + | Ecco alcuni **esempi di log** (ripuliti da informazioni non strettamente necessarie come timestamp, riferimento alla funzione sorgente, ecc.): | ||
| + | |||
| + | ==== Join a dominio di un host ==== | ||
| + | |||
| + | < | ||
| + | _samr_create_user: | ||
| + | Running the command | ||
| + | `/ | ||
| + | gave 0 | ||
| + | Forcing Primary Group to ' | ||
| + | api_rpcTNP: rpc command: SAMR_QUERYUSERINFO | ||
| + | User: | ||
| + | api_rpcTNP: rpc command: SAMR_GETUSERPWINFO | ||
| + | api_rpcTNP: rpc command: SAMR_SETUSERINFO2 | ||
| + | Forcing Primary Group to ' | ||
| + | </ | ||
| + | |||
| + | ==== Logon ==== | ||
| + | |||
| + | < | ||
| + | check_ntlm_password: | ||
| + | [MYDOMAIN]\[myuser]@[MYHOST] with the new password interface | ||
| + | check_ntlm_password: | ||
| + | Forcing Primary Group to ' | ||
| + | check_ntlm_password: | ||
| + | check_ntlm_password: | ||
| + | Forcing Primary Group to ' | ||
| + | </ | ||
| + | |||
| + | ==== Logon fallito ==== | ||
| + | |||
| + | È stato usato un account macchina al posto di un account utente: | ||
| + | |||
| + | < | ||
| + | check_ntlm_password: | ||
| + | [MYDOMAIN]\[MYHOST$]@[MYHOST] with the new password interface | ||
| + | check_ntlm_password: | ||
| + | check_sam_security: | ||
| + | check_ntlm_password: | ||
| + | error NT_STATUS_NO_SUCH_USER, | ||
| </ | </ | ||
doc/appunti/linux/tux/samba.1517844017.txt.gz · Last modified: by niccolo
