{"id":77,"date":"2006-11-13T10:10:40","date_gmt":"2006-11-13T08:10:40","guid":{"rendered":""},"modified":"2009-09-11T00:30:38","modified_gmt":"2009-09-10T22:30:38","slug":"mount-windows-share-protected-by-domain-username-and-password-on-linux","status":"publish","type":"post","link":"https:\/\/rainbowbreeze.it\/wordpress\/mount-windows-share-protected-by-domain-username-and-password-on-linux\/","title":{"rendered":"Mount Windows share (protected by domain username and password) on Linux"},"content":{"rendered":"<p>\n <b>What i wanna do<\/b>\n<\/p>\n<p>\n Within a Windows 2000 domain (with Active Directory), i want connect a Linux box to a Windows box share,&nbsp; and the share have access restrictions on domain users basics, and reconnect each time the linux box restart&nbsp;\n<\/p>\n<p>\n <b>Environment<\/b>: <\/p>\n<ul>\n<li>Windows domain: WINDOMAIN<\/li>\n<li>Windows domain user: WINDOMAIN\\Rainbow<\/li>\n<li>Server name: DMNSRV<\/li>\n<li>Server share: \\\\DMNSRV\\rainbow: only domain admins and domain user Rainbow can access to this share<\/li>\n<li>Linux user: legolas<\/li>\n<\/ul>\n<p><!--more--><\/p>\n<p>\n <b>Some pre-check<\/b>\n<\/p>\n<ul>\n<li>in debian-like distribution, install smbfs (apt-get install \tsmbfs), need to read and write on Windows shares (SMB), and, if not \tinstalled by default, the samba client (apt-get install smbclient) <\/li>\n<li>check \tif you can ping the Windows sharing server within the linux box (ie: \t<i>ping DMNSRV<\/i>). if your domain it&#8217;s a true Windows 2000\/XP\/2003 domain, \tyou must have a dns server and a dns domain name, ie windomain.intra. \tif your linuxbox use the windows domain dns server, try <i>ping DMNSRV.windomain,intra<\/i>. Elsewhere, add the host name to the linux host table (\/etc\/hosts). Assuming that you can ping SMNSRV.windomain.intra <\/li>\n<\/ul>\n<p>\n <b>Made the work<\/b>\n<\/p>\n<ul>\n<li>start linux as legolas user and obtain a command prompt (terminal or text-only mode) <\/li>\n<li>cd \/home\/legolas (or the home directory of legolas user) <\/li>\n<li>create .smbcredentials files and write in this lines<br \/>\n\t \tusername=rainbow<br \/>\n\t \tpassword=<i>rainbow_password<\/i>&nbsp;<\/li>\n<li><i>optional<\/i>: sudo chmod 500 .smbcredtials &amp;&amp; sudo chown root .smbcredentials \tin this way, you make unreadable the file to the legolas linux user, \tit&#8217;s a little security addon if you want to grant access to windows share to \tthe linux user without letting him know the windows user password (and, obviusly, if he cannot became root on the linux box) <\/li>\n<li>mkdir rainbow (or another folder where windows share should be mounted)<\/li>\n<li>sudo vi \/etc\/fstab<br \/>\n\t \tadd this line at the end of the file (it&#8217;s a unique line, don&#8217;t break it)<br \/>\n\t \t\/\/DMNSRV.windomain.intra\/rainbow &nbsp;&nbsp; \/home\/legolas\/rainbow &nbsp;&nbsp; smbfs \tcredentials=\/home\/legolas\/.smbcredentials,uid=legolas,gid=legolas,fmask=0770,dmask=0770,rw&nbsp;&nbsp;&nbsp; \t0&nbsp;&nbsp;&nbsp; 0<\/p>\n<p>\t \t<i>uid<\/i>: set the owner of windows share file to user legolas<br \/>\n\t \t<i>gid<\/i>: set the group of windows share file to group legolas<br \/>\n\t \t<i>fmask<\/i>: set the file permissions to 0770<br \/>\n\t \t<i>dmask<\/i>: set the directory permissions to 0770<br \/>\n\t \t<i>rw<\/i>: files are in read\/write mode<\/li>\n<li>sudo mount rainbow&#8230; And the joke is done ;)<\/li>\n<\/ul>\n<p>\n <br \/>\n <b>Final note<\/b>\n<\/p>\n<ul>\n<li>you can also bypass the creation of <i>.smbcredentials<\/i> file and write Windows user name and password directly in <i>fstab<\/i> file, but i like more this solution, for me is more clear&#8230; <\/li>\n<\/ul>\n<p>\n <br \/>\n Hope this can help someone (me surely)&#8230; Byez!\n<\/p>\n<p>\n{mxc}<\/p>\n","protected":false},"excerpt":{"rendered":"<p>What i wanna do Within a Windows 2000 domain (with Active Directory), i want connect a Linux box to a Windows box share,&nbsp; and the share have access restrictions on domain users basics, and reconnect each time the linux box restart&nbsp; Environment: Windows domain: WINDOMAIN Windows domain user: WINDOMAIN\\Rainbow Server name: DMNSRV Server share: \\\\DMNSRV\\rainbow: &hellip; <a href=\"https:\/\/rainbowbreeze.it\/wordpress\/mount-windows-share-protected-by-domain-username-and-password-on-linux\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Mount Windows share (protected by domain username and password) on Linux<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":3,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":""},"categories":[3],"tags":[],"class_list":["post-77","post","type-post","status-publish","format-standard","hentry","category-tech"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Mount Windows share (protected by domain username and password) on Linux - Rainbowbreeze<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/rainbowbreeze.it\/wordpress\/mount-windows-share-protected-by-domain-username-and-password-on-linux\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Mount Windows share (protected by domain username and password) on Linux - Rainbowbreeze\" \/>\n<meta property=\"og:description\" content=\"What i wanna do Within a Windows 2000 domain (with Active Directory), i want connect a Linux box to a Windows box share,&nbsp; and the share have access restrictions on domain users basics, and reconnect each time the linux box restart&nbsp; Environment: Windows domain: WINDOMAIN Windows domain user: WINDOMAINRainbow Server name: DMNSRV Server share: \\DMNSRVrainbow: &hellip; Continue reading Mount Windows share (protected by domain username and password) on Linux &rarr;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/rainbowbreeze.it\/wordpress\/mount-windows-share-protected-by-domain-username-and-password-on-linux\/\" \/>\n<meta property=\"og:site_name\" content=\"Rainbowbreeze\" \/>\n<meta property=\"article:published_time\" content=\"2006-11-13T08:10:40+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2009-09-10T22:30:38+00:00\" \/>\n<meta name=\"author\" content=\"Alfredo\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@rainbowbreeze\" \/>\n<meta name=\"twitter:site\" content=\"@rainbowbreeze\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Alfredo\" \/>\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:\\\/\\\/rainbowbreeze.it\\\/wordpress\\\/mount-windows-share-protected-by-domain-username-and-password-on-linux\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/rainbowbreeze.it\\\/wordpress\\\/mount-windows-share-protected-by-domain-username-and-password-on-linux\\\/\"},\"author\":{\"name\":\"Alfredo\",\"@id\":\"https:\\\/\\\/rainbowbreeze.it\\\/#\\\/schema\\\/person\\\/00e63c64a3939938a7467e3aaf54f4cf\"},\"headline\":\"Mount Windows share (protected by domain username and password) on Linux\",\"datePublished\":\"2006-11-13T08:10:40+00:00\",\"dateModified\":\"2009-09-10T22:30:38+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/rainbowbreeze.it\\\/wordpress\\\/mount-windows-share-protected-by-domain-username-and-password-on-linux\\\/\"},\"wordCount\":444,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\\\/\\\/rainbowbreeze.it\\\/#\\\/schema\\\/person\\\/00e63c64a3939938a7467e3aaf54f4cf\"},\"articleSection\":[\"Technology\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/rainbowbreeze.it\\\/wordpress\\\/mount-windows-share-protected-by-domain-username-and-password-on-linux\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/rainbowbreeze.it\\\/wordpress\\\/mount-windows-share-protected-by-domain-username-and-password-on-linux\\\/\",\"url\":\"https:\\\/\\\/rainbowbreeze.it\\\/wordpress\\\/mount-windows-share-protected-by-domain-username-and-password-on-linux\\\/\",\"name\":\"Mount Windows share (protected by domain username and password) on Linux - Rainbowbreeze\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/rainbowbreeze.it\\\/#website\"},\"datePublished\":\"2006-11-13T08:10:40+00:00\",\"dateModified\":\"2009-09-10T22:30:38+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/rainbowbreeze.it\\\/wordpress\\\/mount-windows-share-protected-by-domain-username-and-password-on-linux\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/rainbowbreeze.it\\\/wordpress\\\/mount-windows-share-protected-by-domain-username-and-password-on-linux\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/rainbowbreeze.it\\\/wordpress\\\/mount-windows-share-protected-by-domain-username-and-password-on-linux\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/rainbowbreeze.it\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Mount Windows share (protected by domain username and password) on Linux\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/rainbowbreeze.it\\\/#website\",\"url\":\"https:\\\/\\\/rainbowbreeze.it\\\/\",\"name\":\"Rainbowbreeze\",\"description\":\"Alfredo Morresi&#039;s digital harbor\",\"publisher\":{\"@id\":\"https:\\\/\\\/rainbowbreeze.it\\\/#\\\/schema\\\/person\\\/00e63c64a3939938a7467e3aaf54f4cf\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/rainbowbreeze.it\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/rainbowbreeze.it\\\/#\\\/schema\\\/person\\\/00e63c64a3939938a7467e3aaf54f4cf\",\"name\":\"Alfredo\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/rainbowbreeze.it\\\/wordpress\\\/wp-content\\\/uploads\\\/2021\\\/03\\\/rainbowbreeze_profile_700px.jpg\",\"url\":\"https:\\\/\\\/rainbowbreeze.it\\\/wordpress\\\/wp-content\\\/uploads\\\/2021\\\/03\\\/rainbowbreeze_profile_700px.jpg\",\"contentUrl\":\"https:\\\/\\\/rainbowbreeze.it\\\/wordpress\\\/wp-content\\\/uploads\\\/2021\\\/03\\\/rainbowbreeze_profile_700px.jpg\",\"width\":700,\"height\":700,\"caption\":\"Alfredo\"},\"logo\":{\"@id\":\"https:\\\/\\\/rainbowbreeze.it\\\/wordpress\\\/wp-content\\\/uploads\\\/2021\\\/03\\\/rainbowbreeze_profile_700px.jpg\"},\"description\":\"79ers, Italian, with a passion for creating environments in which great ideas can happen and people feel empowered, thanks to community dynamics and technological innovation. I also love nature, open-source, running on the beach, snowboarding and Tiramisu\u2019\",\"sameAs\":[\"https:\\\/\\\/rainbowbreeze.it\\\/\",\"https:\\\/\\\/www.instagram.com\\\/rainbowbreez3\\\/\",\"https:\\\/\\\/linkedin.com\\\/in\\\/alfredomorresi\",\"https:\\\/\\\/x.com\\\/rainbowbreeze\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Mount Windows share (protected by domain username and password) on Linux - Rainbowbreeze","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:\/\/rainbowbreeze.it\/wordpress\/mount-windows-share-protected-by-domain-username-and-password-on-linux\/","og_locale":"en_US","og_type":"article","og_title":"Mount Windows share (protected by domain username and password) on Linux - Rainbowbreeze","og_description":"What i wanna do Within a Windows 2000 domain (with Active Directory), i want connect a Linux box to a Windows box share,&nbsp; and the share have access restrictions on domain users basics, and reconnect each time the linux box restart&nbsp; Environment: Windows domain: WINDOMAIN Windows domain user: WINDOMAINRainbow Server name: DMNSRV Server share: \\DMNSRVrainbow: &hellip; Continue reading Mount Windows share (protected by domain username and password) on Linux &rarr;","og_url":"https:\/\/rainbowbreeze.it\/wordpress\/mount-windows-share-protected-by-domain-username-and-password-on-linux\/","og_site_name":"Rainbowbreeze","article_published_time":"2006-11-13T08:10:40+00:00","article_modified_time":"2009-09-10T22:30:38+00:00","author":"Alfredo","twitter_card":"summary_large_image","twitter_creator":"@rainbowbreeze","twitter_site":"@rainbowbreeze","twitter_misc":{"Written by":"Alfredo","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/rainbowbreeze.it\/wordpress\/mount-windows-share-protected-by-domain-username-and-password-on-linux\/#article","isPartOf":{"@id":"https:\/\/rainbowbreeze.it\/wordpress\/mount-windows-share-protected-by-domain-username-and-password-on-linux\/"},"author":{"name":"Alfredo","@id":"https:\/\/rainbowbreeze.it\/#\/schema\/person\/00e63c64a3939938a7467e3aaf54f4cf"},"headline":"Mount Windows share (protected by domain username and password) on Linux","datePublished":"2006-11-13T08:10:40+00:00","dateModified":"2009-09-10T22:30:38+00:00","mainEntityOfPage":{"@id":"https:\/\/rainbowbreeze.it\/wordpress\/mount-windows-share-protected-by-domain-username-and-password-on-linux\/"},"wordCount":444,"commentCount":1,"publisher":{"@id":"https:\/\/rainbowbreeze.it\/#\/schema\/person\/00e63c64a3939938a7467e3aaf54f4cf"},"articleSection":["Technology"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/rainbowbreeze.it\/wordpress\/mount-windows-share-protected-by-domain-username-and-password-on-linux\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/rainbowbreeze.it\/wordpress\/mount-windows-share-protected-by-domain-username-and-password-on-linux\/","url":"https:\/\/rainbowbreeze.it\/wordpress\/mount-windows-share-protected-by-domain-username-and-password-on-linux\/","name":"Mount Windows share (protected by domain username and password) on Linux - Rainbowbreeze","isPartOf":{"@id":"https:\/\/rainbowbreeze.it\/#website"},"datePublished":"2006-11-13T08:10:40+00:00","dateModified":"2009-09-10T22:30:38+00:00","breadcrumb":{"@id":"https:\/\/rainbowbreeze.it\/wordpress\/mount-windows-share-protected-by-domain-username-and-password-on-linux\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/rainbowbreeze.it\/wordpress\/mount-windows-share-protected-by-domain-username-and-password-on-linux\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/rainbowbreeze.it\/wordpress\/mount-windows-share-protected-by-domain-username-and-password-on-linux\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/rainbowbreeze.it\/"},{"@type":"ListItem","position":2,"name":"Mount Windows share (protected by domain username and password) on Linux"}]},{"@type":"WebSite","@id":"https:\/\/rainbowbreeze.it\/#website","url":"https:\/\/rainbowbreeze.it\/","name":"Rainbowbreeze","description":"Alfredo Morresi&#039;s digital harbor","publisher":{"@id":"https:\/\/rainbowbreeze.it\/#\/schema\/person\/00e63c64a3939938a7467e3aaf54f4cf"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/rainbowbreeze.it\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/rainbowbreeze.it\/#\/schema\/person\/00e63c64a3939938a7467e3aaf54f4cf","name":"Alfredo","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/rainbowbreeze.it\/wordpress\/wp-content\/uploads\/2021\/03\/rainbowbreeze_profile_700px.jpg","url":"https:\/\/rainbowbreeze.it\/wordpress\/wp-content\/uploads\/2021\/03\/rainbowbreeze_profile_700px.jpg","contentUrl":"https:\/\/rainbowbreeze.it\/wordpress\/wp-content\/uploads\/2021\/03\/rainbowbreeze_profile_700px.jpg","width":700,"height":700,"caption":"Alfredo"},"logo":{"@id":"https:\/\/rainbowbreeze.it\/wordpress\/wp-content\/uploads\/2021\/03\/rainbowbreeze_profile_700px.jpg"},"description":"79ers, Italian, with a passion for creating environments in which great ideas can happen and people feel empowered, thanks to community dynamics and technological innovation. I also love nature, open-source, running on the beach, snowboarding and Tiramisu\u2019","sameAs":["https:\/\/rainbowbreeze.it\/","https:\/\/www.instagram.com\/rainbowbreez3\/","https:\/\/linkedin.com\/in\/alfredomorresi","https:\/\/x.com\/rainbowbreeze"]}]}},"_links":{"self":[{"href":"https:\/\/rainbowbreeze.it\/wordpress\/wp-json\/wp\/v2\/posts\/77","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rainbowbreeze.it\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rainbowbreeze.it\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rainbowbreeze.it\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/rainbowbreeze.it\/wordpress\/wp-json\/wp\/v2\/comments?post=77"}],"version-history":[{"count":0,"href":"https:\/\/rainbowbreeze.it\/wordpress\/wp-json\/wp\/v2\/posts\/77\/revisions"}],"wp:attachment":[{"href":"https:\/\/rainbowbreeze.it\/wordpress\/wp-json\/wp\/v2\/media?parent=77"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rainbowbreeze.it\/wordpress\/wp-json\/wp\/v2\/categories?post=77"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rainbowbreeze.it\/wordpress\/wp-json\/wp\/v2\/tags?post=77"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}