My ultimate goal is to configure an HP Officejet Pro 8600 to save scans into a shared folder on my computer (using the "Scan to network folder" functionality of the printer).
So I have configured a folder on my computer as a network share in the following way:
$ net usershare info --long
[LocalNetwork]
path=/path/to/LocalNetwork
comment=
usershare_acl=Everyone:F,
guest_ok=y
I have also configured my UFW firewall to allow access from within the local network to the ports used by Samba:
$ sudo ufw allow from 192.168.178.0/24 to any app Samba
Rule added
$ sudo ufw status verbose
Status: active
Logging: on (low)
Default: deny (incoming), allow (outgoing), disabled (routed)
New profiles: skip
To Action From
137,138/udp (Samba) ALLOW IN 192.168.178.0/24
139,445/tcp (Samba) ALLOW IN 192.168.178.0/24
Both the printer and my computer are in the same network and I use \\<my-ip-address>\LocalNetwork as the network path. Since the printer reports "Connection failed" when testing
the connection, I decided to test it with a Raspberry Pi that is in the same network. When I attempt to mount the folder though, it asks for a password for the root user:
$ sudo mount -t cifs //192.168.178.92/LocalNetwork test_mount_point
Password for root@//192.168.178.92/LocalNetwork:
I didn't expect this, since I configured the folder for guest access. So why does it attempt to authenticate and how can I setup the folder to be accessible without authentication?
Edit
By passing -o guest it doesn't prompt for a password, however I get a mount error(13): Permission denied:
$ sudo mount -t cifs -o guest //192.168.178.92/LocalNetwork test_mount_point
mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
Edit
Following this answer I have added a user via smbpasswd with some password (nopass):
$ sudo smbpasswd -a nobody
When I try to mount the folder using this username and password I get a new error however:
$ sudo mount -v -t cifs -o user=nobody,password=nopass //192.168.178.92/LocalNetwork test_mount_point
mount error(5): Input/output error
Edit: testparm -s
This is the output:
$ testparm -s
Load smb config files from /etc/samba/smb.conf
Loaded services file OK.
Server role: ROLE_STANDALONE
Global parameters
[global]
log file = /var/log/samba/log.%m
logging = file
map to guest = Bad User
max log size = 1000
obey pam restrictions = Yes
pam password change = Yes
panic action = /usr/share/samba/panic-action %d
passwd chat = Enter\snew\s\spassword:* %n\n Retype\snew\s\spassword:* %n\n password\supdated\ssuccessfully .
passwd program = /usr/bin/passwd %u
server role = standalone server
server string = %h server (Samba, Ubuntu)
unix password sync = Yes
usershare allow guests = Yes
usershare owner only = No
idmap config * : backend = tdb
[LocalNetwork]
create mask = 0777
guest ok = Yes
path = /path/to/LocalNetwork
read only = No
