{"id":207,"date":"2013-08-13T05:08:47","date_gmt":"2013-08-13T05:08:47","guid":{"rendered":"https:\/\/digitalchild.info\/?p=207"},"modified":"2013-08-13T05:08:47","modified_gmt":"2013-08-13T05:08:47","slug":"samba-3-6-idmap","status":"publish","type":"post","link":"https:\/\/randomadult.local\/samba-3-6-idmap\/","title":{"rendered":"Samba 3.6 idmap"},"content":{"rendered":"

I have a couple of file servers in my network running Samba 3.6 as member servers. Something that you would want to get going at some point is syncing the UID\/GID across the machines so that if you want to move the data around the uids\/gids are the same. The way to make this work is with the idmap configurations. I hadn’t done this and in my stupidity had created a second file server that couldn’t move files to and from the first. IDIOT!<\/p>\n

In Samba 3.6 \u00a0idmap was completely re-written<\/a> as it was a bit broken before then and its actually quite simple to have your machines all talking the same uid\/gid. This is to use the idmap_rid system. From the samba docs<\/a>.<\/p>\n

The\u00a0idmap_rid<\/code>\u00a0facility is a new tool that, unlike native winbind, creates a predictable mapping of MS Windows SIDs to UNIX UIDs and GIDs<\/p><\/blockquote>\n

If you have already setup your file server without using idmap_rid you can change how it works by adding the following lines to your global section of your samba conf file. Replacing the lines and or removing lines as required.<\/p>\n

\n\nworkgroup = MYDOMAIN\npassword server = pdc.mydomain.com\nencrypt passwords = Yes\nrealm = MYDOMAIN.COM\nsecurity = ads\nallow trusted domains = false\nidmap config * : backend = tdb\nidmap config * : range = 10001-20000\nidmap config MYDOMAIN : backend = rid\nidmap config MYDOMAIN : range = 5000-10000\nidmap config MYDOMAIN : base_rid = 0\n\n<\/pre>\n

I’m not sure if this step is needed but I removed the member server from the domain. Then I restarted samba and winbind, rejoined the member server and I was still getting the old Ids. I realised that winbind was caching the old Id’s and no matter what I did I couldn’t work out how to update them.\u00a0After searching around for quite a while I found this blog post<\/a> from Alex Cline. The commands are very straight forward.<\/p>\n

 net cache flush <\/pre>\n

It’s really that simple. I found posts all over the place talking about killing the samba data directory in \/var\/lib\/samba and that all sounded a little crazy. I’m glad its as simple as that. To test that this worked, just run the following command to see the new id from winbind.<\/p>\n

 id -u username <\/pre>\n

This should output your new rid generated id.<\/p>\n

Rinse and repeat for any other servers you might have.<\/p>\n","protected":false},"excerpt":{"rendered":"

I have a couple of file servers in my network running Samba 3.6 as member servers. Something that you would want to get going at some point is syncing the UID\/GID across the machines so that if you want to move the data around the uids\/gids are the same. The …<\/p>\n

Samba 3.6 idmap<\/span> Read More \u00bb<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":""},"categories":[5],"tags":[34,66,92,166,170],"yoast_head":"\nSamba 3.6 idmap - Random Adult<\/title>\n<meta name=\"description\" content=\"I have a couple of file servers in my network running Samba 3.6 as member servers. Something that you would want to get going at some point is syncing the UID\/GID across the machines so that if you want to move the data around the uids\/gids are the same. The way to make this work is with the idmap configurations\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/randomadult.local\/samba-3-6-idmap\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Samba 3.6 idmap\" \/>\n<meta property=\"og:description\" content=\"I have a couple of file servers in my network running Samba 3.6 as member servers. Something that you would want to get going at some point is syncing the UID\/GID across the machines so that if you want to move the data around the uids\/gids are the same. The way to make this work is with the idmap configurations\" \/>\n<meta property=\"og:url\" content=\"https:\/\/randomadult.local\/samba-3-6-idmap\/\" \/>\n<meta property=\"og:site_name\" content=\"Random Adult\" \/>\n<meta property=\"article:published_time\" content=\"2013-08-13T05:08:47+00:00\" \/>\n<meta name=\"author\" content=\"digitalchild\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@dcwhatwhat\" \/>\n<meta name=\"twitter:site\" content=\"@dcwhatwhat\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"digitalchild\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/randomadult.local\/samba-3-6-idmap\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/randomadult.local\/samba-3-6-idmap\/\"},\"author\":{\"name\":\"digitalchild\",\"@id\":\"https:\/\/randomadult.local\/#\/schema\/person\/b0b954202434291ace51b4e7a0a81c04\"},\"headline\":\"Samba 3.6 idmap\",\"datePublished\":\"2013-08-13T05:08:47+00:00\",\"dateModified\":\"2013-08-13T05:08:47+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/randomadult.local\/samba-3-6-idmap\/\"},\"wordCount\":403,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/randomadult.local\/#organization\"},\"keywords\":[\"centos\",\"file server\",\"idmap\",\"rid\",\"samba\"],\"articleSection\":[\"Geek\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/randomadult.local\/samba-3-6-idmap\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/randomadult.local\/samba-3-6-idmap\/\",\"url\":\"https:\/\/randomadult.local\/samba-3-6-idmap\/\",\"name\":\"Samba 3.6 idmap - Random Adult\",\"isPartOf\":{\"@id\":\"https:\/\/randomadult.local\/#website\"},\"datePublished\":\"2013-08-13T05:08:47+00:00\",\"dateModified\":\"2013-08-13T05:08:47+00:00\",\"description\":\"I have a couple of file servers in my network running Samba 3.6 as member servers. Something that you would want to get going at some point is syncing the UID\/GID across the machines so that if you want to move the data around the uids\/gids are the same. The way to make this work is with the idmap configurations\",\"breadcrumb\":{\"@id\":\"https:\/\/randomadult.local\/samba-3-6-idmap\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/randomadult.local\/samba-3-6-idmap\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/randomadult.local\/samba-3-6-idmap\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/randomadult.local\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Samba 3.6 idmap\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/randomadult.local\/#website\",\"url\":\"https:\/\/randomadult.local\/\",\"name\":\"Random Adult\",\"description\":\"Ramblings of a random adult\",\"publisher\":{\"@id\":\"https:\/\/randomadult.local\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/randomadult.local\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/randomadult.local\/#organization\",\"name\":\"Random Adult\",\"url\":\"https:\/\/randomadult.local\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/randomadult.local\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/randomadult.local\/wp-content\/uploads\/2020\/01\/logo.png\",\"contentUrl\":\"https:\/\/randomadult.local\/wp-content\/uploads\/2020\/01\/logo.png\",\"width\":320,\"height\":134,\"caption\":\"Random Adult\"},\"image\":{\"@id\":\"https:\/\/randomadult.local\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/twitter.com\/dcwhatwhat\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/randomadult.local\/#\/schema\/person\/b0b954202434291ace51b4e7a0a81c04\",\"name\":\"digitalchild\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/randomadult.local\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/e0331079f6730910bc7760cb8f781237?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/e0331079f6730910bc7760cb8f781237?s=96&d=mm&r=g\",\"caption\":\"digitalchild\"},\"url\":\"https:\/\/randomadult.local\/author\/digitalchild\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Samba 3.6 idmap - Random Adult","description":"I have a couple of file servers in my network running Samba 3.6 as member servers. Something that you would want to get going at some point is syncing the UID\/GID across the machines so that if you want to move the data around the uids\/gids are the same. The way to make this work is with the idmap configurations","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/randomadult.local\/samba-3-6-idmap\/","og_locale":"en_US","og_type":"article","og_title":"Samba 3.6 idmap","og_description":"I have a couple of file servers in my network running Samba 3.6 as member servers. Something that you would want to get going at some point is syncing the UID\/GID across the machines so that if you want to move the data around the uids\/gids are the same. The way to make this work is with the idmap configurations","og_url":"https:\/\/randomadult.local\/samba-3-6-idmap\/","og_site_name":"Random Adult","article_published_time":"2013-08-13T05:08:47+00:00","author":"digitalchild","twitter_card":"summary_large_image","twitter_creator":"@dcwhatwhat","twitter_site":"@dcwhatwhat","twitter_misc":{"Written by":"digitalchild","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/randomadult.local\/samba-3-6-idmap\/#article","isPartOf":{"@id":"https:\/\/randomadult.local\/samba-3-6-idmap\/"},"author":{"name":"digitalchild","@id":"https:\/\/randomadult.local\/#\/schema\/person\/b0b954202434291ace51b4e7a0a81c04"},"headline":"Samba 3.6 idmap","datePublished":"2013-08-13T05:08:47+00:00","dateModified":"2013-08-13T05:08:47+00:00","mainEntityOfPage":{"@id":"https:\/\/randomadult.local\/samba-3-6-idmap\/"},"wordCount":403,"commentCount":0,"publisher":{"@id":"https:\/\/randomadult.local\/#organization"},"keywords":["centos","file server","idmap","rid","samba"],"articleSection":["Geek"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/randomadult.local\/samba-3-6-idmap\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/randomadult.local\/samba-3-6-idmap\/","url":"https:\/\/randomadult.local\/samba-3-6-idmap\/","name":"Samba 3.6 idmap - Random Adult","isPartOf":{"@id":"https:\/\/randomadult.local\/#website"},"datePublished":"2013-08-13T05:08:47+00:00","dateModified":"2013-08-13T05:08:47+00:00","description":"I have a couple of file servers in my network running Samba 3.6 as member servers. Something that you would want to get going at some point is syncing the UID\/GID across the machines so that if you want to move the data around the uids\/gids are the same. The way to make this work is with the idmap configurations","breadcrumb":{"@id":"https:\/\/randomadult.local\/samba-3-6-idmap\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/randomadult.local\/samba-3-6-idmap\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/randomadult.local\/samba-3-6-idmap\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/randomadult.local\/"},{"@type":"ListItem","position":2,"name":"Samba 3.6 idmap"}]},{"@type":"WebSite","@id":"https:\/\/randomadult.local\/#website","url":"https:\/\/randomadult.local\/","name":"Random Adult","description":"Ramblings of a random adult","publisher":{"@id":"https:\/\/randomadult.local\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/randomadult.local\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/randomadult.local\/#organization","name":"Random Adult","url":"https:\/\/randomadult.local\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/randomadult.local\/#\/schema\/logo\/image\/","url":"https:\/\/randomadult.local\/wp-content\/uploads\/2020\/01\/logo.png","contentUrl":"https:\/\/randomadult.local\/wp-content\/uploads\/2020\/01\/logo.png","width":320,"height":134,"caption":"Random Adult"},"image":{"@id":"https:\/\/randomadult.local\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/twitter.com\/dcwhatwhat"]},{"@type":"Person","@id":"https:\/\/randomadult.local\/#\/schema\/person\/b0b954202434291ace51b4e7a0a81c04","name":"digitalchild","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/randomadult.local\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/e0331079f6730910bc7760cb8f781237?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/e0331079f6730910bc7760cb8f781237?s=96&d=mm&r=g","caption":"digitalchild"},"url":"https:\/\/randomadult.local\/author\/digitalchild\/"}]}},"_links":{"self":[{"href":"https:\/\/randomadult.local\/wp-json\/wp\/v2\/posts\/207"}],"collection":[{"href":"https:\/\/randomadult.local\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/randomadult.local\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/randomadult.local\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/randomadult.local\/wp-json\/wp\/v2\/comments?post=207"}],"version-history":[{"count":0,"href":"https:\/\/randomadult.local\/wp-json\/wp\/v2\/posts\/207\/revisions"}],"wp:attachment":[{"href":"https:\/\/randomadult.local\/wp-json\/wp\/v2\/media?parent=207"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/randomadult.local\/wp-json\/wp\/v2\/categories?post=207"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/randomadult.local\/wp-json\/wp\/v2\/tags?post=207"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}