How to get simple-scan and xsane working Ubuntu

Sometimes when you install simple-scan it works as root, but not as an ordinary user.

Ensure that your user-name is in group scanner. You will have to logout and login again to get the OS to notice the change.

Install sane-utils and run sane-find-scanner as an ordinary user to ensure that your scanner is found. Also, scanimage -L may be useful.

For remote scanning over the network you may need to edit /etc/default/saned to change the RUN_AS_USER parameter from 'saned' to 'root'. On Ubuntu 16 and later saned is no longer used. Instead, you just have to set the user and device permissions correctly

I had to add a new rules file in /etc/udev/rules.d/99-saned.rules

  ENV{libsane_matched}=="yes" ACTION=="add" RUN+="/bin/chmod 660 %N" RUN+="/bin/chgrp scanner %N"
After that I could run sane-find-scanner (for USB scanners) as an ordinary user and also scanimage -L" (for any scanner). Without the rule they would only run as root. The libsane_matched env-var is set by rules in /lib/udev/rules.d. Not needed now that saned no longer exists.

On a remote machine only scanimage -L works.

See https://askubuntu.com/questions/1122426/saned-service-loaded-masked-dev-null-bad-active-inactive-dead-needed-for