Saned linux ��� ���

Saned linux ��� ���

The -d and -s flags request that saned run in debug mode (as opposed to inetd (8) mode). In this mode, saned explicitly waits for a connection request. When compiled with debugging enabled, these flags may be followed by a number to request debug info. The larger the number, the more verbose the debug output. E.g., -d128 will request printing of all debug info. Debug level 0 means no debug output at all. The default value is 2. If flag -d is used, the debug messages will be printed to stderr while -s requests using syslog.

If saned is run from inetd or xinetd, no option can be given.

CONFIGURATION

The contents of the saned.conf file is a list of host names, IP addresses or IP subnets (CIDR notation) that are permitted to use local SANE devices. IPv6 addresses must be enclosed in brackets, and should always be specified in their compressed form. Connections from localhost are always permitted. Empty lines and lines starting with a hash mark (#) are ignored. A line containing the single character «+» is interpreted to match any hostname. This allows any remote machine to use your scanner and may present a security risk, so this shouldn’t be used unless you know what you’re doing. A sample configuration file is shown below:

scan-client.somedomain.firm
# this is a comment
192.168.0.1
192.168.2.12/29
[::1]
[2001:7a8:185e::42:12]/64

The case of the host names does not matter, so AHost.COM is considered identical to ahost.com.

For saned to work properly, it is also necessary to add a configuration line to /etc/inetd.conf . Note that your inetd must support IPv6 if you want to connect to saned over IPv6 ; xinetd and openbsd-inetd are known to support IPv6, check the documentation for your inetd daemon.

The configuration line normally looks like this:

sane-port stream tcp nowait saned.saned /usr/sbin/saned saned

However, if your system uses tcpd (8) for additional security screening, you may want to disable saned access control by putting «+» in saned.conf and use a line of the following form in /etc/inetd.conf instead:

sane-port stream tcp nowait saned.saned /usr/sbin/tcpd /usr/sbin/saned

Note that both examples assume that there is a saned group and a saned user. If you follow this example, please make sure that the access permissions on the special device are set such that saned can access the scanner (the program generally needs read and write access to scanner devices).

If xinetd is installed on your system instead of inetd the following example for xinetd.conf may be helpful:

Finally, it is also necessary to add a line of the following form to /etc/services :

sane-port 6566/tcp # SANE network scanner daemon

The official IANA short name for port 6566 is «sane-port». The older name «sane» is now deprecated.

RESTRICTIONS


FILES

access to the listed backends is restricted. A backend may be listed multiple times for different user/password combinations. The server uses MD5 encryption if supported by the client.

Источник

Ubuntu Documentation

SANE — Scanner Access Now Easy

Introduction

SANE (Scanner Access Now Easy) is the linux way of scanning. sane supports a great many scanners, and the community around SANE adds support for more scanners all the time. By and large, most supported scanners are plug and play simple (plug them in and your ready to scan). However, some scanners will require manual installation (see the sane Troubleshooting guide for help with manual installation).

Читайте также:  Установка сервера ssh windows

About this tutorial

This tutorial will walk you through the basic set up of sane with plug and play scanners.

Assumptions

We make the following assumptions in this tutorial (you will need to adjust these to fit your situation)

  • This set up assumes that we are on a small home or office network and are behind a firewall.
  • Our LAN is an IP4 network on subnet 192.168.0.0/24 (192.168.0.0 — 192.168.0.255)
  • Our Ubuntu box is 192.168.0.23
  • Our USB scanner is located at libusb:001:003
  • Our SCSI scanner is at /dev/sg1
  • Our network scanner is at 192.168.0.15
  • Our scanner uses the example backend (example-backend)

Setting up SANE

Step 1: Installing sane

Sane should be installed as a base package in Ubuntu 11.04 and later. You can run the following command to install it (if it’s already installed, it will do nothing):

This will also install the xsane front end. Note that some scanners will require other packages to be installed. Those are covered in the sane Troubleshooting guide.

Step 2: Test your scanner

Run following command to test your scanner:

You should see a dialog for scanning from your scanner. If SANE says that it can’t find the scanner, you will need to do a manual installation.

Manual Scanner Installation

Most of the time, the back-end for your scanner will be enabled by default. For some scanners, you will need to enable it manually. This usually involves enabling the back-end, and then adding your scanner to it.

For detailed instructions on manual installation, see the Ubuntu SANE Troubleshooting guide.

Installing Network Scanners

Many network scanners work with sane in one of two ways. The scanner can have its own sane server, or it can be supported by a backend.

Scanners with AirScan Support

Most modern scanners come with support for either Apple AirScan / AirPrint scanning (the official protocol name is «eSCL») OR Microsoft WSD, aka «Web Services for Devices».

These are both «driverless» scanning protocols and SANE supports both of these protocols with its sane-escl (eSCL only)and AirScan (eSCL and WSD) backends.

Both backends support network and USB scanners.

Scanners with their own SANE servers

Scanners with their own SANE server, as well as scanners connected to a computer running the saned service can be easily added to other computers on the network by enabling the NET backend and adding the servers IP address in the net.conf file.

1. To enable the net backend, edit the file /etc/sane.d/dll.conf by running the following command:

Within that file, you need to uncomment the NET backend. In our case, change the line that reads

2. We need to add our server or servers to the /etc/sane.d/net.conf. You can edit that file as root using this command:

3. Add your SANED server address as an IP4, IP6, hosts or DNS resolvable name

Save your file and close.

Scanners with SANE backends

SANE Backends are available for a number of network scanners. In general, all these need is to specify the protocol, address and port of your server.

1. Our example backend configuration file is /etc/sane.d/example.conf. You can edit that file as root using this command:

3. Find the line that reads:

and after it add the protocol, address and port of your network server. In our case, its

4. After you have added that line, save the file and close gedit.

Sharing your scanner with SANE

SANE allows you to easily share scanners across a network. To set up the sharing of your scanner using saned, see [https://help.ubuntu.com/community/sane.d%20tutorial]

Third Party Drivers

Many of the most popular scanners require the installation of third-party drivers.

Читайте также:  Лучший синтезатор речи для windows

Brother Scanners

Brother offers proprietary SANE drivers for its family of network scanners and multi-function devices.

To install, visit [http://support.brother.com/g/s/id/linux/en/download_scn.html] and download the proper driver for your scanner (brscan, brscan2, brscan3 or brscan4) and your computer (32 or 64 bit) to your desktop. NOTE: You need the 64 bit .deb version!

Run the following command to install the driver you just downloaded (note: the example below is for the brscan2 package. You will have to change the file name to match what you downloaded)

After you have installed the scanner driver, you need to run the Brother SANE Configuration tool. When you run that tool, you need to append the device name (what you want to call it), the model number and the ip address of the scanner. In the example below, we are using the «brsaneconfig2» tool, we calling the scanner «MyScanner», the model we are installing is the MFC-660CN and the IP address is 192.168.0.15.

NOTE: One issue that confuses a lot of users is the difference between brscan, brscan2, brscan3, brscan4 and brscan5. Each of these tools supports a different set of scanners, and you need to download the appropriate package for your scanner. Because it is possible to install many different scanners, you need to run the proper version of the brsaneconfig tool. If your scanner is supported by the brscan3 tool, you will need to run the brsaneconfig3 tool to configure it.

NOTE: Many older Brother Scanners (brscan, brscan2, brscan3) will need some manual configuration. See the Ubuntu SANE Troubleshooting guide for specific instructions on troubleshooting these scanners using the symlink and udev rules.

HP Scanners

The majority of HP scanners are supported by the hplip project. Setting up an HP scanner can be done using the following command:

This wizard will set up your scanner for use with SANE.

Samsung Scanners

Samsung scanner users are advised to install drivers via the The Samsung Unified Linux Driver Repository. See [http://www.bchemnet.com/suldr/index.html] for information on the SULDR project.

sane (последним исправлял пользователь 5g3-steven-7tv 2020-10-28 17:20:13)

The material on this wiki is available under a free license, see Copyright / License for details
You can contribute to this wiki, see Wiki Guide for details

Источник

SYNOPSIS¶

OPTIONS¶

If the -r flag is specified, saned will also report remote scanners (those that are accessed via saned’s «net» backend) when receiving an inquiry to list all devices. As the remote scanner may not be available at the time of the request, enabling this option may cause a significant delay, experienced by the remote client. Default is not to report those scanners.

The -d and -s flags request that saned run in debug mode (as opposed to inetd(8) daemon mode). In this mode, saned explicitly waits for a connection request. When compiled with debugging enabled, these flags may be followed by a number to request debug info. The larger the number, the more verbose the debug output. E.g., -d128 will request printing of all debug info. Debug level 0 means no debug output at all. The default value is 2. If flag -d is used, the debug messages will be printed to stderr while -s requests using syslog.

If saned is run from inetd, xinetd or systemd, no option can be given.

The -h flag displays a short help message.

CONFIGURATION¶

The saned.conf configuration file contains both options for the daemon and the access list.

data_portrange = min_portmax_port Specify the port range to use for the data connection. Pick a port range between 1024 and 65535; don’t pick a too large port range, as it may have performance issues. Use this option if your saned server is sitting behind a firewall. If that firewall is a Linux machine, we strongly recommend using the Netfilter nf_conntrack_sane module instead.

Читайте также:  Посмотреть список пользователей linux debian

reexport_remote_scanners = [ true | yes | 1 ] Enables reporting remote scanners (those accessed via saned’s «net» backend) to clients. As the remote scanner may not be available at the time of the request, enabling this option may cause a significant delay, experienced by the remote client. Any value other than «true», «yes» or «1» will keep this option disabled, which is the default when this option nor the command line flag «-r» is specified.

The access list is a list of host names, IP addresses or IP subnets (CIDR notation) that are permitted to use local SANE devices. IPv6 addresses must be enclosed in brackets, and should always be specified in their compressed form. Connections from localhost are always permitted. Empty lines and lines starting with a hash mark (#) are ignored. A line containing the single character «+» is interpreted to match any hostname. This allows any remote machine to use your scanner and may present a security risk, so this shouldn’t be used unless you know what you’re doing.

A sample configuration file is shown below:

The case of the host names does not matter, so AHost.COM is considered identical to ahost.com.

SERVER DAEMON CONFIGURATION¶

In the sections below the configuration for inetd, xinetd and systemd are described in more detail.

For the configurations below it is necessary to add a line of the following form to /etc/services:

The official IANA short name for port 6566 is «sane-port». The older name «sane» is now deprecated.

INETD CONFIGURATION¶

The configuration line normally looks like this:

However, if your system uses tcpd(8) for additional security screening, you may want to disable saned access control by putting «+» in saned.conf and use a line of the following form in /etc/inetd.conf instead:

Note that both examples assume that there is a saned group and a saned user. If you follow this example, please make sure that the access permissions on the special device are set such that saned can access the scanner (the program generally needs read and write access to scanner devices).

XINETD CONFIGURATION¶

SYSTEMD CONFIGURATION¶

Saned can be used wih systemd without the systemd integration compiled in, but then logging of debug information is not supported.

The systemd configuration is different for the 2 options, so both are described below.

Systemd configuration for saned with systemd support compiled in¶

The first file we need to add here is called saned.socket. It shall have the following contents:

The second file to be added is saned@.service with the following contents:

You need to set an environment variable for SANE_CONFIG_DIR pointing to the directory where saned can find its configuration files. you will have to remove the # on the last line and set the variables for the desired debugging information if required. Multiple variables can be set by separating the assignments by spaces as shown in the example above.

Unlike (x)inetd , systemd allows debugging output from backends set using SANE_DEBUG_XXX to be captured. See the man-page for your backend to see what options are supported. With the service unit as described above, the debugging output is forwarded to the system log.

Systemd configuration when saned is compiled without systemd support¶

for systemd configuration for saned, we need to add 2 configuration files in /etc/systemd/system.

The first file we need to add here is called saned.socket. It is identical to the version for systemd with the support compiled in. It shall have the following contents:

The second file to be added is saned@.service This one differes from the sersion with systemd integration compiled in:

FILES¶

access to the listed backends is restricted. A backend may be listed multiple times for different user/password combinations. The server uses MD5 hashing if supported by the client.

Источник

Оцените статью