{"id":147,"date":"2008-11-03T21:00:08","date_gmt":"2008-11-03T09:00:08","guid":{"rendered":"http:\/\/p-s.co.nz\/wordpress\/?p=147"},"modified":"2008-11-04T07:19:57","modified_gmt":"2008-11-03T19:19:57","slug":"ubuntu-samba-and-sharing-folders-and-printers","status":"publish","type":"post","link":"https:\/\/p-s.co.nz\/wordpress\/ubuntu-samba-and-sharing-folders-and-printers\/","title":{"rendered":"Ubuntu, Samba, and Sharing Folders and Printers"},"content":{"rendered":"<p><strong>Sharing a Printer<\/strong><\/p>\n<p>The easiest way of sharing the printer was to hook it up to the router with its own ethernet cable. Then it was a case of System > Administration > Printing and clicking on New.  The networked printer was identified correctly as the first item with the IP address and Port No.  The driver had already been added <a href=\"http:\/\/p-s.co.nz\/wordpress\/?p=13\">http:\/\/p-s.co.nz\/wordpress\/?p=13<\/a> and it was a matter of selecting it.  This worked on every computer on the LAN.<\/p>\n<p>From within virtualised Windows XP it was trickier.  Start > Control Panel > Printers and Faxes then Add a Printer, Next, then, counterintuitively, do NOT select network printer but select Local printer (leave plug and play unticked).  Then it was a matter of creating a new port of the Standard TCP\/IP type.  The IP address of the printer was added (printing printer settings directly from the printer menu included the current IP address).  Once created, this is the port to use.  The rest is straight forward.<\/p>\n<p><strong>Sharing a Folder<\/strong><\/p>\n<p>From Server End ****************************<br \/>\nNeed to edit \/etc\/samba\/smb.conf<br \/>\nsudo gedit \/etc\/samba\/smb.conf<br \/>\nKey features (NB rather too much trial and error for my liking &#8211; it worked for me but would prefer to have any recommendations arise out of a clear understanding \ud83d\ude09 ) :<\/p>\n<p>[global]<\/p>\n<p>security = share<\/p>\n<p>## Browsing\/Identification ###<\/p>\n<p># Change this to the workgroup\/NT-domain name your Samba server will part of<br \/>\n    workgroup = realworkgroupnamehere<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>Find, and ensure it is commented out:<br \/>\n;    map to guest = bad user<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p># Allow users who&#8217;ve been granted usershare privileges to create<br \/>\n# public shares, not just authenticated ones<br \/>\n;    usershare allow guests = yes<br \/>\n;    username map = \/etc\/samba\/smbusers<br \/>\n    security = share<br \/>\n;    guest ok = no<br \/>\nguest account = root<\/p>\n<p>At the end:<\/p>\n<p>[sharename]<br \/>\n    path = \/path\/path\/sharename<br \/>\n    public = yes<br \/>\n    locking = no<br \/>\n    writable = yes<br \/>\n    browsable = yes<br \/>\n    guest ok = yes<br \/>\n    guest only = yes<\/p>\n<p>Can check that everything came through with<br \/>\ntestparm<br \/>\nthen Enter to see dump:<\/p>\n<p>sudo \/etc\/init.d\/samba reload # reload samba so changes in smb.conf take hold.<br \/>\n&#8230;<\/p>\n<p>From Client End *****************************<br \/>\nMake folder ready to mount on top off: sudo mkdir \/media\/sharedfoldername<br \/>\nThen configure mounting in such a way that it is automatic on startup:<br \/>\nsudo gedit \/etc\/fstab # edit contents of fstab (what you want mounted and how)<br \/>\nThen add something like:<\/p>\n<p><code>\/\/server_IP\/sharedfoldername \/media\/sharedname cifs auto,owner,rw,username=guest,workgroup=workgroupname,uid=user_id_local_machine,gid=user_id_local_machine 0 0<\/code><\/p>\n<p>Find user id from System > Administration > Users and Groups then look at Properties > Advanced tab in User ID:<br \/>\nsudo mount -a # mounts everything in \/etc\/fstab<\/p>\n<p>You should be able to add and edit documents etc.<\/p>\n<p>Useful Commands<br \/>\nsudo mount -a # mounts everything in \/etc\/fstab<br \/>\nsudo gedit \/etc\/fstab # edit contents of fstab (what you want mounted and how)<br \/>\nsudo umount \/path\/more\/sharedfolder # unmount (ready to remount if testing changes to fstab)<\/p>\n<p>NB there is another approach to this presented in <a href=\"http:\/\/blogs.pcworld.co.nz\/pcworld\/tux-love\/2008\/09\/hidden_linux_diy_file_server.html\">http:\/\/blogs.pcworld.co.nz\/pcworld\/tux-love\/2008\/09\/hidden_linux_diy_file_server.html<\/a> but I was unable to get it to work for reasons which elude me.  Perhaps it will work for you \ud83d\ude42 .<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sharing a Printer The easiest way of sharing the printer was to hook it up to the router with its own ethernet cable. Then it was a case of System > Administration > Printing and clicking on New. The networked &hellip; <a href=\"https:\/\/p-s.co.nz\/wordpress\/ubuntu-samba-and-sharing-folders-and-printers\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-147","post","type-post","status-publish","format-standard","hentry","category-ubuntu"],"_links":{"self":[{"href":"https:\/\/p-s.co.nz\/wordpress\/wp-json\/wp\/v2\/posts\/147"}],"collection":[{"href":"https:\/\/p-s.co.nz\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/p-s.co.nz\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/p-s.co.nz\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/p-s.co.nz\/wordpress\/wp-json\/wp\/v2\/comments?post=147"}],"version-history":[{"count":16,"href":"https:\/\/p-s.co.nz\/wordpress\/wp-json\/wp\/v2\/posts\/147\/revisions"}],"predecessor-version":[{"id":152,"href":"https:\/\/p-s.co.nz\/wordpress\/wp-json\/wp\/v2\/posts\/147\/revisions\/152"}],"wp:attachment":[{"href":"https:\/\/p-s.co.nz\/wordpress\/wp-json\/wp\/v2\/media?parent=147"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/p-s.co.nz\/wordpress\/wp-json\/wp\/v2\/categories?post=147"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/p-s.co.nz\/wordpress\/wp-json\/wp\/v2\/tags?post=147"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}