0

So basically, I'm having the exact same issue as the guy in this thread. I can see the samba print share, but not access it from windows. The top answer, which looks promising states that I must do the following:

You need to add a guest user to the samba password database. Usually it is done by mapping guest in samba configuration files to a UNIX existing user; give that user printing rights via groups; then you should be able to access the printer via the \server\ URI.

Can somebody please explain to me how exactly this is done? I've googled around and it hasn't been of much help.

Thanks!

UPDATE
here is the printer portion of my /etc/samba.conf file. let me know if you want the rest and i'll put it in a google doc or something

[printers]
comment = All Printers
; browseable = yes
path = /var/spool/samba
printable = yes
guest ok = yes
; read only = no
guest account = blain
create mask = 0700

1

In order to set up guest access in Samba, you need to set up a user that it will pretend to log in as. So, let's say you want to share files on /mnt/somepartition/files publically. Your configuration might look like this:

[public_files]
    comment = Public files
    path = /mnt/somepartition/files
    browsable = yes
    guest ok = yes
    writable = yes
    guest account = someusername
    create mask = 0775
    directory mask = 0755

What this saying is "Create a samba share on \mymachine\public_files that is viewable to anonymous users (not hidden like user files generally are) and enable it for write access. Anonymous users can access this share by using someusername's credentials. When files are created, make them globally executable but restrict write access globally. When directories are created, make them globally executable but only writable by someusername."

Once this is done, you will need to create a smbpassword, per your question. To do this, ensure first that the user exists within your server. If the user doesn't, create it:

sudo adduser someusername

Once the user exists, create a samba login:

sudo smbpasswd -a someusername

A couple of things to keep in mind: the directory that public_files points to will need to be READ accessible to someusername. Make sure you set the permissions correctly. If the directory is owned by you but still want to make them available, add someusername to a common group and then change the group ownership.

  • when executing the 2nd command i get "failed to find entry for user someusername" – Blaine May 28 '16 at 9:29
  • may have to do with the fact that my config is slightly different to yours possibly because i'm sharing a printer not a directory – Blaine May 28 '16 at 9:30
  • sorry, try sudo smbpasswd -a someusername – scuba_mike May 28 '16 at 9:51
  • 1
    I don't have a USB printer so I'm not sure how to help you much further than giving you [wiki.samba.org/index.php/… documentation). What is the error message you're getting when you connect to the Samba share? – scuba_mike May 28 '16 at 13:47
  • 1
    The answer here is correct: you need to issue sudo smbpasswd -a blaine as blaine is the 'guest account' user set in your samba config. The reason is that samba is trying to become the 'blaine' user in order to print, but it can't find that user in its own database. – lorenzog May 28 '16 at 17:54

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.