{"id":109,"date":"2013-01-05T22:29:31","date_gmt":"2013-01-05T20:29:31","guid":{"rendered":"http:\/\/icefront.info\/wp\/?p=109"},"modified":"2013-01-05T22:29:31","modified_gmt":"2013-01-05T20:29:31","slug":"set-up-a-samba-server-on-linux","status":"publish","type":"post","link":"https:\/\/icefront.info\/index.php\/2013\/01\/05\/set-up-a-samba-server-on-linux\/","title":{"rendered":"Set up a Samba server on Linux"},"content":{"rendered":"<p>With a Samba server installed and running on Linux, we can access partly or the whole system via LAN.<\/p>\n<p>Install Samba:<\/p>\n<pre>apt-get install samba<\/pre>\n<p>Follow the install wizard and enter &#8220;workgroup&#8221; or the group your network uses.<\/p>\n<p>The outside access can be configured for a special directory and for a special user or it&#8217;s possible to see the entire system. The latter can be used for administration purposes via LAN, but it&#8217;s not recommended for production servers or for paranoiac users.<\/p>\n<h3>Set up restricted access<\/h3>\n<ol>\n<li>(On the server) add a directory for samba shares\n<pre>mkdir \/samba<\/pre>\n<p>(Change the \/samba directory according to your needs)<\/li>\n<li>Add a usergroup for samba\n<pre>groupadd sambagroup<\/pre>\n<\/li>\n<li>Give the directory to the group\n<pre>chgrp sambagroup \/samba<\/pre>\n<\/li>\n<li>Change the rights\n<pre>chmod 0777 \/samba<\/pre>\n<\/li>\n<li>Add a user\n<pre>useradd -g sambagroup winuser<\/pre>\n<\/li>\n<li>Give the user a password\n<pre>passwd winuser<\/pre>\n<\/li>\n<li>Add samba password. This will be the password to access the server.\n<pre>smbpasswd -a winuser<\/pre>\n<\/li>\n<li>Enable user in samba\n<pre>smbpasswd -e winuser<\/pre>\n<\/li>\n<li>Add the following to <strong>\/etc\/samba\/smb.conf<\/strong>. Change the SambaShareName to a nice one.\n<pre>[SambaShareName]\npath = \/samba\nwritable = yes\npublic = no\nvalid users = winuser\nforce create mode = 0777\nforce directory mode = 0777<\/pre>\n<\/li>\n<li>Restart the Samba server (every time you make changes to \/etc\/samba\/smb.conf, the Samba server needs to be restarted).\n<pre>\/etc\/init.d\/samba restart<\/pre>\n<\/li>\n<\/ol>\n<h3>Set up full access<\/h3>\n<p>It&#8217;s not a problem to give full access to the whole system if the server isn&#8217;t accessible from outside the router or the local area network is accessed only by the developer(s).<\/p>\n<ol>\n<li>Add samba password\n<pre>smbpasswd -a root<\/pre>\n<\/li>\n<li>Enable user in samba\n<pre>smbpasswd -e root<\/pre>\n<\/li>\n<li>Add the following to <strong>\/etc\/samba\/smb.conf<\/strong>\n<pre>[SambaShareName]\npath=\/\nwritable=yes\npublic=no\nvalid users=root\nforce create mode = 0777\nforce directory mode = 0777<\/pre>\n<\/li>\n<li>Restart the Samba server\n<pre>\/etc\/init.d\/samba restart<\/pre>\n<\/li>\n<\/ol>\n<p>Note: in a Windows system, you will see the server as &#8220;SambaShareName&#8221;. Change this name accordingly.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>With a Samba server installed and running on Linux, we can access partly or the whole system via LAN. Install Samba: apt-get install samba Follow the install wizard and enter &#8220;workgroup&#8221; or the group your network uses. The outside access can be configured for a special directory and for a special user or it&#8217;s possible [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-109","post","type-post","status-publish","format-standard","hentry","category-debian"],"_links":{"self":[{"href":"https:\/\/icefront.info\/index.php\/wp-json\/wp\/v2\/posts\/109","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/icefront.info\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/icefront.info\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/icefront.info\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/icefront.info\/index.php\/wp-json\/wp\/v2\/comments?post=109"}],"version-history":[{"count":0,"href":"https:\/\/icefront.info\/index.php\/wp-json\/wp\/v2\/posts\/109\/revisions"}],"wp:attachment":[{"href":"https:\/\/icefront.info\/index.php\/wp-json\/wp\/v2\/media?parent=109"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/icefront.info\/index.php\/wp-json\/wp\/v2\/categories?post=109"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/icefront.info\/index.php\/wp-json\/wp\/v2\/tags?post=109"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}