{"id":3418,"date":"2022-12-20T17:02:37","date_gmt":"2022-12-20T20:02:37","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/saned-man8\/"},"modified":"2022-12-20T17:02:37","modified_gmt":"2022-12-20T20:02:37","slug":"saned-man8","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/saned-man8\/","title":{"rendered":"saned (man8)"},"content":{"rendered":"<h1 align=\"center\">saned<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#SYNOPSIS\">SYNOPSIS<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#OPTIONS\">OPTIONS<\/a><br \/> <a href=\"#CONFIGURATION\">CONFIGURATION<\/a><br \/> <a href=\"#SERVER DAEMON CONFIGURATION\">SERVER DAEMON CONFIGURATION<\/a><br \/> <a href=\"#INETD CONFIGURATION\">INETD CONFIGURATION<\/a><br \/> <a href=\"#XINETD CONFIGURATION\">XINETD CONFIGURATION<\/a><br \/> <a href=\"#SYSTEMD CONFIGURATION\">SYSTEMD CONFIGURATION<\/a><br \/> <a href=\"#Systemd configuration for saned with systemd support compiled in\">Systemd configuration for saned with systemd support compiled in<\/a><br \/> <a href=\"#Systemd configuration when saned is compiled without systemd support\">Systemd configuration when saned is compiled without systemd support<\/a><br \/> <a href=\"#FILES\">FILES<\/a><br \/> <a href=\"#ENVIRONMENT\">ENVIRONMENT<\/a><br \/> <a href=\"#SEE ALSO\">SEE ALSO<\/a><br \/> <a href=\"#AUTHOR\">AUTHOR<\/a> <\/p>\n<hr>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">saned \u2212 SANE network daemon<\/p>\n<h2>SYNOPSIS <a name=\"SYNOPSIS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>saned [ \u2212a<\/b> <i>[ username ]<\/i> <b>] [ \u2212u<\/b> <i>username<\/i> <b>] [ \u2212b<\/b> <i>address<\/i> <b>] [ \u2212p<\/b> <i>port<\/i> <b>] [ \u2212l ] [ \u2212D ] [ \u2212o ] [ \u2212d<\/b> <i>n<\/i> <b>] [ \u2212e ] [ \u2212h ]<\/b><\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>saned<\/b> is the SANE (Scanner Access Now Easy) daemon that allows remote clients to access image acquisition devices available on the local host.<\/p>\n<h2>OPTIONS <a name=\"OPTIONS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>saned<\/b> recognises the following options: <b><br \/> \u2212a<\/b> <i>[username]<\/i>, <b>\u2212\u2212alone<\/b>[=<i>username]<\/i><\/p>\n<p style=\"margin-left:22%;\">is equivalent to the combination of <b>\u2212l \u2212D \u2212u<\/b> <i>username<\/i> options. However, <i>username<\/i> is optional and running user will only be set when specified.<\/p>\n<p style=\"margin-left:11%;\"><b>\u2212u<\/b> <i>username<\/i>, <b>\u2212\u2212user<\/b>=<i>username<\/i><\/p>\n<p style=\"margin-left:22%;\">requests that <b>saned<\/b> drop root privileges and run as the user (and group) associated with <i>username<\/i> after binding.<\/p>\n<p style=\"margin-left:11%;\"><b>\u2212b<\/b> <i>address<\/i>, <b>\u2212\u2212bind<\/b>=<i>address<\/i><\/p>\n<p style=\"margin-left:22%;\">tells <b>saned<\/b> to bind to the <i>address<\/i> given.<\/p>\n<p style=\"margin-left:11%;\"><b>\u2212p<\/b> <i>port<\/i>, <b>\u2212\u2212port=<\/b><i>port<\/i><\/p>\n<p style=\"margin-left:22%;\">tells <b>saned<\/b> to listen on the <i>port<\/i> given. A value of 0 tells <b>saned<\/b> to pick an unused port. The default is the <b>sane-port (6566).<\/b><\/p>\n<p style=\"margin-left:11%;\"><b>\u2212l<\/b>, <b>\u2212\u2212listen<\/b><\/p>\n<p style=\"margin-left:22%;\">requests that <b>saned<\/b> run in standalone daemon mode. In this mode, <b>saned<\/b> will listen for incoming client connections; <b>inetd<\/b>(8) is not required for <b>saned<\/b> operations in this mode.<\/p>\n<p style=\"margin-left:11%;\"><b>\u2212D<\/b>, <b>\u2212\u2212daemonize<\/b><\/p>\n<p style=\"margin-left:22%;\">will request <b>saned<\/b> to detach from the console and run in the background.<\/p>\n<p style=\"margin-left:11%;\"><b>\u2212o<\/b>, <b>\u2212\u2212once<\/b><\/p>\n<p style=\"margin-left:22%;\">requests that <b>saned<\/b> exits after the first client disconnects. This is useful for debugging.<\/p>\n<p style=\"margin-left:11%;\"><b>\u2212d<\/b> <i>n<\/i>, <b>\u2212\u2212debug<\/b>=<i>n<\/i><\/p>\n<p style=\"margin-left:22%;\">sets the level of <b>saned<\/b> debug output to <i>n<\/i>. When compiled with debugging enabled, this flag may be followed by a number to request more or less debug info. The larger the number, the more verbose the debug output. E.g., <b>\u2212d128<\/b> will request output of all debug info. A level of 0 produces no output at all. The default value is 2.<\/p>\n<p style=\"margin-left:11%;\"><b>\u2212e<\/b>, <b>\u2212\u2212stderr<\/b><\/p>\n<p style=\"margin-left:22%;\">will divert <b>saned<\/b> debug output to stderr instead of the syslog default.<\/p>\n<p style=\"margin-left:11%;\"><b>\u2212h<\/b>, <b>\u2212\u2212help<\/b><\/p>\n<p style=\"margin-left:22%;\">displays a short help message.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">If <b>saned<\/b> is run from other programs such as <b>inetd<\/b>(8), <b>xinetd<\/b>(8) and <b>systemd<\/b>(1), check that program\u2019s documentation on how to pass command-line options.<\/p>\n<h2>CONFIGURATION <a name=\"CONFIGURATION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">First and foremost: <b>saned<\/b> is not intended to be exposed to the internet or other non-trusted networks. Make sure that access is limited by tcpwrappers and\/or a firewall setup. Don\u2019t depend only on <b>saned<\/b>\u2019s own authentication. Don\u2019t run <b>saned<\/b> as root if it\u2019s not necessary. And do <b>not<\/b> install <b>saned<\/b> as setuid root.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The <i>saned.conf<\/i> configuration file contains both options for the daemon and the access list. <b><br \/> data_portrange<\/b> = <i>min_port<\/i> &#8211; <i>max_port<\/i><\/p>\n<p style=\"margin-left:22%;\">Specify the port range to use for the data connection. Pick a port range between 1024 and 65535; don\u2019t pick a too large port range, as it may have performance issues. Use this option if your <b>saned<\/b> server is sitting behind a firewall. If that firewall is a Linux machine, we strongly recommend using the Netfilter <i>nf_conntrack_sane<\/i> module instead.<\/p>\n<p style=\"margin-left:11%;\"><b>data_connect_timeout<\/b> = <i>timeout<\/i><\/p>\n<p style=\"margin-left:22%;\">Specify the time in milliseconds that <b>saned<\/b> will wait for a data connection. Without this option, if the data connection is not done before the scanner reaches the end of scan, the scanner will continue to scan past the end and may damage it depending on the backend. Specify zero to have the old behavior. The default is 4000ms.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">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 \u2018\u2018+\u2019\u2019 is interpreted to match any hostname. This allows any remote machine to use your scanner and may present a security risk, so this shouldn\u2019t be used unless you know what you\u2019re doing.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">A sample configuration file is shown below:<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\"># Daemon options <br \/> data_portrange = 10000 &#8211; 10100 <br \/> # Access list <br \/> scan\u2212client.somedomain.firm <br \/> # this is a comment <br \/> 192.168.0.1 <br \/> 192.168.2.12\/29 <br \/> [::1] <br \/> [2001:db8:185e::42:12]\/64<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The case of the host names does not matter, so AHost.COM is considered identical to ahost.com.<\/p>\n<h2>SERVER DAEMON CONFIGURATION <a name=\"SERVER DAEMON CONFIGURATION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">For <b>saned<\/b> to work properly in its default mode of operation, it is also necessary to add the appropriate configuration for <b>xinetd<\/b>(8), <b>inetd<\/b>(8) or <b>systemd<\/b>(1) (see below). Note that your <b>inetd<\/b>(8) must support IPv6 if you want to connect to <b>saned<\/b> over IPv6; <b>xinetd<\/b>(8), <b>openbsd-inetd<\/b>(8) and <b>systemd<\/b>(1) are known to support IPv6, check the documentation for your <b>inetd<\/b>(8) daemon.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">In the sections below the configuration for <b>inetd<\/b>(8), <b>xinetd<\/b>(8) and <b>systemd<\/b>(1) are described in more detail.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">For the configurations below it is necessary to add a line of the following form to <i>\/etc\/services<\/i>:<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\">sane\u2212port 6566\/tcp # SANE network scanner daemon<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The official IANA short name for port 6566 is &#8220;sane\u2212port&#8221;. The older name &#8220;sane&#8221; is now deprecated.<\/p>\n<h2>INETD CONFIGURATION <a name=\"INETD CONFIGURATION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">It is required to add a single line to the <b>inetd<\/b>(8) configuration file <i>(\/etc\/inetd.conf)<\/i><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The configuration line normally looks like this:<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\">sane\u2212port stream tcp nowait saned.saned \/usr\/sbin\/saned saned<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">However, if your system uses <b>tcpd<\/b>(8) for additional security screening, you may want to disable <b>saned<\/b> access control by putting \u2018\u2018+\u2019\u2019 in <i>saned.conf<\/i> and use a line of the following form in <i>\/etc\/inetd.conf<\/i> instead:<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\">sane\u2212port stream tcp nowait saned.saned \/usr\/sbin\/tcpd \/usr\/sbin\/saned<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Note that both examples assume that there is a <b>saned<\/b> group and a <b>saned<\/b> user. If you follow this example, please make sure that the access permissions on the special device are set such that <b>saned<\/b> can access the scanner (the program generally needs read and write access to scanner devices).<\/p>\n<h2>XINETD CONFIGURATION <a name=\"XINETD CONFIGURATION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">If <b>xinetd<\/b>(8) is installed on your system instead of <b>inetd<\/b>(8) the following example for <i>\/etc\/xinetd.conf<\/i> may be helpful:<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\"># default: off <br \/> # description: The sane server accepts requests <br \/> # for network access to a local scanner via the <br \/> # network. <br \/> service sane\u2212port <br \/> { <br \/> port = 6566 <br \/> socket_type = stream <br \/> wait = no <br \/> user = saned <br \/> group = saned <br \/> server = \/usr\/sbin\/saned <br \/> }<\/p>\n<h2>SYSTEMD CONFIGURATION <a name=\"SYSTEMD CONFIGURATION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>saned<\/b> can be compiled with explicit <b>systemd<\/b>(1) support. This will allow logging debugging information to be forwarded to the <b>systemd<\/b>(1) journal. The <b>systemd<\/b>(1) support requires compilation with the systemd-devel package installed on the system. This is the preferred option.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>saned<\/b> can be used with <b>systemd<\/b>(1) without the <b>systemd<\/b>(1) integration compiled in, but then logging of debug information is not supported.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The <b>systemd<\/b>(1) configuration is different for the 2 options, so both are described below.<\/p>\n<h2>Systemd configuration for saned with systemd support compiled in <a name=\"Systemd configuration for saned with systemd support compiled in\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">For <b>systemd<\/b>(1) configuration we need to add 2 configuration files in <i>\/etc\/systemd\/system<\/i>.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The first file we need to add here is called <i>saned.socket.<\/i> It shall have the following contents:<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\">[Unit] <br \/> Description=saned incoming socket<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\">[Socket] <br \/> ListenStream=6566 <br \/> Accept=yes <br \/> MaxConnections=1<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\">[Install] <br \/> WantedBy=sockets.target<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The second file to be added is <i>saned@.service<\/i> with the following contents:<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\">[Unit] <br \/> Description=Scanner Service <br \/> Requires=saned.socket<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\">[Service] <br \/> ExecStart=\/usr\/sbin\/saned <br \/> User=saned <br \/> Group=saned <br \/> StandardInput=null <br \/> StandardOutput=syslog <br \/> StandardError=syslog <br \/> Environment=SANE_CONFIG_DIR=\/etc\/sane.d <br \/> # If you need to debug your configuration uncomment the next line and <br \/> # change it as appropriate to set the desired debug options <br \/> # Environment=SANE_DEBUG_DLL=255 SANE_DEBUG_BJNP=5<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\">[Install] <br \/> Also=saned.socket<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">You need to set an environment variable for <b>SANE_CONFIG_DIR<\/b> pointing to the directory where <b>saned<\/b> 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.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Unlike <b>xinetd<\/b>(8) and <b>inetd<\/b>(8), <b>systemd<\/b>(1) allows debugging output from backends set using <b>SANE_DEBUG_XXX<\/b> 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.<\/p>\n<h2>Systemd configuration when saned is compiled without systemd support <a name=\"Systemd configuration when saned is compiled without systemd support\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">This configuration will also work when <b>saned<\/b> is compiled WITH <b>systemd<\/b>(1) integration support, but it does not allow debugging information to be logged.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">For <b>systemd<\/b>(1) configuration for <b>saned<\/b>, we need to add 2 configuration files in <i>\/etc\/systemd\/system<\/i>.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The first file we need to add here is called <i>saned.socket.<\/i> It is identical to the version for <b>systemd<\/b>(1) with the support compiled in. It shall have the following contents:<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\">[Unit] <br \/> Description=saned incoming socket<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\">[Socket] <br \/> ListenStream=6566 <br \/> Accept=yes <br \/> MaxConnections=1<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\">[Install] <br \/> WantedBy=sockets.target<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The second file to be added is <i>saned@.service<\/i>. This one differs from the version with <b>systemd<\/b>(1) integration compiled in:<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\">[Unit] <br \/> Description=Scanner Service <br \/> Requires=saned.socket<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\">[Service] <br \/> ExecStart=\/usr\/sbin\/saned <br \/> User=saned <br \/> Group=saned <br \/> StandardInput=socket<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\">Environment=SANE_CONFIG_DIR=\/etc\/sane.d<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\">[Install] <br \/> Also=saned.socket<\/p>\n<h2>FILES <a name=\"FILES\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><i>\/etc\/hosts.equiv<\/i><\/p>\n<p style=\"margin-left:22%;\">The hosts listed in this file are permitted to access all local SANE devices. Caveat: this file imposes serious security risks and its use is not recommended.<\/p>\n<p style=\"margin-left:11%;\"><i>\/etc\/sane.d\/saned.conf<\/i><\/p>\n<p style=\"margin-left:22%;\">Contains a list of hosts permitted to access local SANE devices (see also description of <b>SANE_CONFIG_DIR<\/b> below).<\/p>\n<p style=\"margin-left:11%;\"><i>\/etc\/sane.d\/saned.users<\/i><\/p>\n<p style=\"margin-left:22%;\">If this file contains lines of the form<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\">user:password:backend<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\">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.<\/p>\n<h2>ENVIRONMENT <a name=\"ENVIRONMENT\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>SANE_CONFIG_DIR<\/b><\/p>\n<p style=\"margin-left:22%;\">This environment variable specifies the list of directories that may contain the configuration file. On *NIX systems, the directories are separated by a colon (\u2018:\u2019), under OS\/2, they are separated by a semi-colon (\u2018;\u2019). If this variable is not set, the configuration file is searched in two default directories: first, the current working directory (&#8220;.&#8221;) and then in <i>\/etc\/sane.d<\/i>. If the value of the environment variable ends with the directory separator character, then the default directories are searched after the explicitly specified directories. For example, setting <b>SANE_CONFIG_DIR<\/b> to &#8220;\/tmp\/config:&#8221; would result in directories <i>tmp\/config<\/i>, <i>.<\/i>, and <i>\/etc\/sane.d<\/i> being searched (in this order).<\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>sane<\/b>(7), <b>scanimage<\/b>(1), <b>xscanimage<\/b>(1), <b>xcam<\/b>(1), <b>sane\u2212dll<\/b>(5), <b>sane\u2212net<\/b>(5), <b>sane\u2212&#8221;backendname&#8221;<\/b>(5), <b>inetd<\/b>(8), <b>xinetd<\/b>(8), <b>systemd<\/b>(1) <i><br \/> http:\/\/www.penguin-breeder.org\/?page=sane\u2212net<\/i><\/p>\n<h2>AUTHOR <a name=\"AUTHOR\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">David Mosberger<\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  saned \u2212 SANE network daemon <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[5,52,4,546],"class_list":["post-3418","post","type-post","status-publish","format-standard","hentry","category-8-administracion-del-sistema","tag-5","tag-administracion","tag-man8","tag-saned"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/3418","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/comments?post=3418"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/3418\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=3418"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=3418"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=3418"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}