🌐 이 글의 한국어 원문이 있습니다.한국어 원문 보기 →
Using HP OfficeJet Scan to Network Folder with an Ubuntu Server
The scanner on HP OfficeJet printers has a feature that saves scanned files to a ‘network folder.’

It supports saving to a Samba-style network folder — in other words, it lets you save scans to a ‘Windows shared folder.’ Samba shares are also supported by FreeNAS and Ubuntu.
While using the scanner, I thought it would be convenient if scans could go straight to my file server and be picked up from there, so I was setting up the feature. But it just wouldn't work. I checked whether the password was entered correctly and whether the path was right, and when that got me nowhere, I finally decided to turn on Samba logging on the server side.
To get logs, you need to adjust the settings in the smb.conf file (on Ubuntu, the path is /etc/samba/smb.conf).
log level = 3If you set the log level as above, logs pile up in the log file at the specified level. On Ubuntu, the path is /var/log/samba/log.smbd.
log level = 3 passdb:5 auth:5As shown above, besides the base log level, you can raise the log level for specific components only.
log level = 10The highest log level is 10. For more details on log settings, see man smb.conf.
...
[2022/01/07 08:01:43.068753, 3] ../../lib/util/access.c:369(allow_access)
Allowed connection from 123.123.123.123 (123.123.123.123)Checking the logs, I could clearly see it got as far as ‘connection allowed.’ So it wasn't a ‘login’ issue. Login works fine, and my guess was that something somewhere after that wasn't lining up, so it failed.
Out of curiosity, I searched for the keywords HP OfficeJet Pro scan network folder ubuntu fail and found the post below.
https://h30434.www3.hp.com/t5/Scanning-Faxing-Copying/HP-Officejet-Pro-8620-scan-to-network-folder-unable-to/td-p/6863901h30434.www3.hp.comI have solved the issue, with smbv1 being a security flaw (wannacry i believe) it has been disabled by freenas and other operating systems with recent updates.
so i added this command to re-enable on my server.
sysctl freenas.services.smb.config.server_min_protocol=NT1
This seems to describe the fix for when it doesn't work on FreeNAS. Min protocol? Curious, I then searched the man page for smb.conf for the keyword NT1 and found the following.
server min protocol (G)
This setting controls the minimum protocol version that the server will allow the client to
use.
Normally this option should not be set as the automatic negotiation phase in the SMB
protocol takes care of choosing the appropriate protocol unless you have legacy clients
which are SMB1 capable only.
See Related command: server max protocol for a full list of available protocols.
Default: server min protocol = SMB2_02
Example: server min protocol = NT1
So it's an option that sets the minimum supported protocol version. NT1 is the dialect supported by Windows NT. I added the line server min protocol = NT1 to the config file smb.conf and restarted the service.

It works ;)
Today's lesson: when something doesn't work, don't panic — try logs + man pages + search.

