{"id":3765,"date":"2013-12-18T17:28:18","date_gmt":"2013-12-18T17:28:18","guid":{"rendered":"http:\/\/www.webputzer.com\/?p=3765"},"modified":"2013-12-19T23:49:34","modified_gmt":"2013-12-19T23:49:34","slug":"adding-a-samba-user","status":"publish","type":"post","link":"http:\/\/www.webputzer.com\/?p=3765","title":{"rendered":"Adding a Samba User"},"content":{"rendered":"<br \/>\n<h1>Adding a Samba User<\/h1>\n<p>To add a samba user follow these steps:<\/p>\n<p>[a] First, add Linux\/UNIX user using the standard useradd\/adduser command.<\/p>\n<p>[b] Then, use same user name to add to Samba share using smbpasswd command.<\/p>\n<h2>Step # 1: Add a user &#8220;joe&#8221; to UNIX\/Linux system<\/h2>\n<p>adduser<br \/>\n  command adds  user  to the system according to command line options<br \/>\nand configuration  information in \/etc\/adduser.conf.  <\/p>\n<p>Type any one of the following command:<br \/> <code># useradd joe<br \/> # passwd joe<\/code><br \/> OR<br \/> <code>adduser joe<\/code><\/p>\n<h2>Step # 2: Add a user to samba<\/h2>\n<p>Now<br \/>\n user joe has account on Linux\/UNIX box. Use <strong>smbpasswd<\/strong> command to<br \/>\nspecifies that the username following should be added to the local<br \/>\nsmbpasswd  file:<br \/> <code># smbpasswd -a joe<\/code><\/p>\n<h2>Step # 3: Add a user to a Samba share<\/h2>\n<p>By<br \/>\n default user gets access to \/home\/joe from windows system. Let us say<br \/>\nyou want to give joe access to \/data\/accounts (make sure directory<br \/>\n\/data\/accounts exists) directory. Open \/etc\/samba\/smb.conf file and<br \/>\nadd\/modify share called [accounts]:<\/p>\n<pre>[accounts]\r\ncomment = Accounts data directory\r\npath = \/data\/accounts\r\nvalid users = vivek raj joe\r\npublic = no\r\nwritable = yes\r\n<\/pre>\n<p>Save the file.<\/p>\n<h2>Step #4:  Restart samba<\/h2>\n<p>The way in which you restart samba is, of course, distro and system specific.  Typically, you&#8217;ll restart samba with a command like:<\/p>\n<p><code># service smb restart<\/code><br \/> OR<br \/>\n<code># \/etc\/init.d\/smb reload<\/code> <br \/>OR<br \/>\n<code># \/usr\/local\/sbin\/smb  restart<\/code><br \/> OR<br \/>\n<code># \/usr\/sbin\/smb  restart<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Adding a Samba User To add a samba user follow these steps: [a] First, add Linux\/UNIX user using the standard useradd\/adduser command. [b] Then, use same user name to add to Samba share using smbpasswd command. Step # 1: Add a user &#8220;joe&#8221; to UNIX\/Linux system adduser command adds user to the system according to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":3768,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"h5ap_radio_sources":[],"footnotes":""},"categories":[1],"tags":[],"class_list":["post-3765","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized"],"_links":{"self":[{"href":"http:\/\/www.webputzer.com\/index.php?rest_route=\/wp\/v2\/posts\/3765","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.webputzer.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.webputzer.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.webputzer.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.webputzer.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3765"}],"version-history":[{"count":0,"href":"http:\/\/www.webputzer.com\/index.php?rest_route=\/wp\/v2\/posts\/3765\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.webputzer.com\/index.php?rest_route=\/wp\/v2\/media\/3768"}],"wp:attachment":[{"href":"http:\/\/www.webputzer.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3765"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.webputzer.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3765"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.webputzer.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3765"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}