Scanners

Write suggestions and new ideas in here
More ideas here http://community.linuxmint.com/idea/welcome
Forum rules
  • Only post ideas here that are specifically about the Linux Mint distribution or its websites.
  • So that developers and users from any distribution can discuss ideas in one place, post ideas about improving software to the collaboration website for that software instead.
borgward
Level 5
Level 5
Posts: 801
Joined: Mon Dec 17, 2012 10:18 pm

Scanners

Post by borgward »

Something needs to be done so that a normal user can run a scanner. Given that a particular scanner works with mint, you still need root permissions to run it. Then you need to run a graphics application under root to use the image. This is a very bad idea. Of course one could change ownership, etc of the image, but that's not a very elegant solution. I can understand the scanner needing root permissions in a multi user situation, but that's not efficient way to do things at home. I have been through many permutations of changing scanner ownership and permissions to little avail. Have dealt with the sane community as well. I am going to do a fresh install of mint and try getting the scanner to work for the normal user. Scanners only running under root is a common problem with many current Linux distros. Is there somewhere else I need to voice my concerns? I am currently running CentOs 5.9 on a 32 bit machine so I can run my scanner as a normal user out of the box. I find that odd, as CentOs usually won't let a normal user do very much with out root permissions.
User avatar
xenopeek
Level 24
Level 24
Posts: 24927
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

Re: Scanners

Post by xenopeek »

That sounds very strange. I've never had to be root to scan something and the image was never owned by root. Why would you need to be root to be able to use say Simple Scan?
Image
User avatar
Bolle1961
Level 5
Level 5
Posts: 739
Joined: Tue Jun 29, 2010 12:59 pm
Contact:

Re: Scanners

Post by Bolle1961 »

A long time ago Brother MFC-7420 needed root permissions to scan, unless you added the Brother to the udev.rules ?? (not quite sure about that filename), but that was mentioned on their site, including instructions.
“Only when the last tree has been cut down, the last fish been caught, and the last stream poisoned, will we realize we cannot eat money.” ― Cree Indian Prophecy
Image
borgward
Level 5
Level 5
Posts: 801
Joined: Mon Dec 17, 2012 10:18 pm

Re: Scanners

Post by borgward »

xenopeek wrote:That sounds very strange. I've never had to be root to scan something
That's the way it works with LinuxMInt 17.1 MATE 32bit.
xenopeek wrote:and the image was never owned by root.
That's because you scanned without root privileges. If you have to scan under root, root owns the image.
xenopeek wrote: Why would you need to be root to be able to use say Simple Scan?
That's the $64,000 question. In my case, because LinuxMInt 17.1 MATE 32bit does not even see the scanner unless you invoke su. At the point the image belongs to root, and the normal user can not do anything with it unless they run graphics program under root, su.

Scanners used to work easily in earlier versions of mint. Are you running a scanner right now? What Mint are you running it with? I am not using this discussion to discover how to run the scanner as a normal user see below:

viewtopic.php?f=51&t=220609&p=1157681&h ... d#p1157681
viewtopic.php?f=47&t=221262&p=1162017&h ... d#p1162017

This is a common problem with current Linux distros. You can see many questions about this all over the web. It is common with USB, Parallel and SCSI scanners. I am going to reinstall Mint on an extra drive and start from fresh. I have made so many ownership, permission changes that clutter is probably a factor. I think that so many people are having this runs only under root problem that the underlying cause of it needs to be addressed. Scanners used to run with normal user, why not now.
Last edited by borgward on Tue May 17, 2016 8:44 pm, edited 2 times in total.
borgward
Level 5
Level 5
Posts: 801
Joined: Mon Dec 17, 2012 10:18 pm

Re: Scanners

Post by borgward »

Bolle1961 wrote:A long time ago Brother MFC-7420 needed root permissions to scan, unless you added the Brother to the udev.rules ?? (not quite sure about that filename), but that was mentioned on their site, including instructions.
udev.rules is what I will next deal with.
Cardenio
Level 1
Level 1
Posts: 46
Joined: Wed Nov 26, 2014 12:11 pm

Re: Scanners

Post by Cardenio »

Just checking in to report that my scanner works fine without root.

HP multifunction; hplip installed from HP website; graphic xsane; Xfce running on top of Mint 17.3 Mate.
User avatar
xenopeek
Level 24
Level 24
Posts: 24927
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

Re: Scanners

Post by xenopeek »

I or family members are using Linux Mint 17.3 with Cinnamon, Debian 8 with Gnome, Arch Linux with Gnome, Fedora with Gnome, Ubuntu 16.04, and a few others. I can't recall having to install anything on any of them. USB connected HP scanner and 2 network connected HP multifunctionals all work.
Image
borgward
Level 5
Level 5
Posts: 801
Joined: Mon Dec 17, 2012 10:18 pm

Re: Scanners

Post by borgward »

17 Cinnamon wont run on my old machine. had to install 17.1 MATE which has the root permission problem. Will try 17.3 MATE. In any case, way too many complaints in all distros not running scanners as normal user. Did your stuff run scanner out of the box, or did you have to do anything else to make it work. If so what?
Last edited by borgward on Tue May 17, 2016 8:45 pm, edited 1 time in total.
User avatar
xenopeek
Level 24
Level 24
Posts: 24927
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

Re: Scanners

Post by xenopeek »

USB scanner just works, didn't need anything done. Network connected multifunctionals I recall on Debian 8 Gnome could be added through System Settings > Printers and didn't need anything else. I kept an installation log for that install.

Perhaps there's a difference per manufacturer; probably...
Image
Cosmo.
Level 23
Level 23
Posts: 17817
Joined: Sat Dec 06, 2014 7:34 am

Re: Scanners

Post by Cosmo. »

borgward wrote:17 Cinnamon wont run on my old machine. had to install 17.1 xfce
That is strange in itself, as both have the same Ubuntu base with only a minor difference in the kernel version. A corrupted ISO-download seems to be more likely.

Regarding the original problem. I have read (cannot confirm from own experience), that the problem can arise in some cases (hardware-dependent). To solve this you have to edit the file

Code: Select all

/lib/udev/rules.d/50-udev-default.rules
Search for the line:

Code: Select all

SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", MODE="0664"
and change 0664 to 0666. This is only a temporary solution, because this file will get overwritten by the next update; but it should be usable to find out, if this helps.
If so, you can create a new file in the same directory with a higher index-number in the name (e.g. 52-udev-default.rules) and copy the line into it.

Note: Not my own experience, but taken from the German Ubuntu-Wiki; so the link to the source is probably not helpful for you.
borgward
Level 5
Level 5
Posts: 801
Joined: Mon Dec 17, 2012 10:18 pm

Re: Scanners

Post by borgward »

I reinstalled Linux Mint 17-1 MATE on an extra drive. I used a modern machine to do the install via USB. Simple scan will not run the Scanner as a normal user. I did sudo simple-scan, and the scanner scanned. This time the image is owned by root, but I could open it with Image Viewer and Gimp as normal user and print.

cat /lib/udev/rules.d/50-udev-default.rules
# do not edit this file, it will be overwritten on update

SUBSYSTEM=="virtio-ports", KERNEL=="vport*", ATTR{name}=="?*", SYMLINK+="virtio-ports/$attr{name}"

# select "system RTC" or just use the first one
SUBSYSTEM=="rtc", ATTR{hctosys}=="1", SYMLINK+="rtc"
SUBSYSTEM=="rtc", KERNEL=="rtc0", SYMLINK+="rtc", OPTIONS+="link_priority=-100"

SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", IMPORT{builtin}="usb_id", IMPORT{builtin}="hwdb --subsystem=usb"
SUBSYSTEM=="input", ENV{ID_INPUT}=="", IMPORT{builtin}="input_id"
ENV{MODALIAS}!="", IMPORT{builtin}="hwdb --subsystem=$env{SUBSYSTEM}"

ACTION!="add", GOTO="default_permissions_end"

SUBSYSTEM=="tty", KERNEL=="ptmx", GROUP="tty", MODE="0666"
SUBSYSTEM=="tty", KERNEL=="tty", GROUP="tty", MODE="0666"
SUBSYSTEM=="tty", KERNEL=="tty[0-9]*", GROUP="tty", MODE="0620"
SUBSYSTEM=="vc", KERNEL=="vcs*|vcsa*", GROUP="tty"
KERNEL=="tty[A-Z]*[0-9]|pppox[0-9]*|ircomm[0-9]*|noz[0-9]*|rfcomm[0-9]*", GROUP="dialout"

SUBSYSTEM=="mem", KERNEL=="mem|kmem|port", GROUP="kmem", MODE="0640"

SUBSYSTEM=="input", KERNEL=="mouse*|mice|event*", MODE="0640"
SUBSYSTEM=="input", KERNEL=="ts[0-9]*|uinput", MODE="0640"
SUBSYSTEM=="input", KERNEL=="js[0-9]*", MODE="0644"

SUBSYSTEM=="video4linux", GROUP="video"
SUBSYSTEM=="misc", KERNEL=="agpgart", GROUP="video"
SUBSYSTEM=="graphics", GROUP="video"
SUBSYSTEM=="drm", GROUP="video"
SUBSYSTEM=="dvb", GROUP="video"

SUBSYSTEM=="sound", GROUP="audio", \
OPTIONS+="static_node=snd/seq", OPTIONS+="static_node=snd/timer"

SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", MODE="0664"

SUBSYSTEM=="firewire", ATTR{units}=="*0x00a02d:0x00010*", GROUP="video"
SUBSYSTEM=="firewire", ATTR{units}=="*0x00b09d:0x00010*", GROUP="video"
SUBSYSTEM=="firewire", ATTR{units}=="*0x00a02d:0x010001*", GROUP="video"
SUBSYSTEM=="firewire", ATTR{units}=="*0x00a02d:0x014001*", GROUP="video"

KERNEL=="parport[0-9]*", GROUP="lp"
SUBSYSTEM=="printer", KERNEL=="lp*", GROUP="lp"
SUBSYSTEM=="ppdev", GROUP="lp"
KERNEL=="lp[0-9]*", GROUP="lp"
KERNEL=="irlpt[0-9]*", GROUP="lp"
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ENV{ID_USB_INTERFACES}=="*:0701??:*", GROUP="lp"

SUBSYSTEM=="block", GROUP="disk"
SUBSYSTEM=="block", KERNEL=="fd[0-9]", GROUP="floppy"
SUBSYSTEM=="block", KERNEL=="sr[0-9]*", GROUP="cdrom"
SUBSYSTEM=="scsi_generic", SUBSYSTEMS=="scsi", ATTRS{type}=="4|5", GROUP="cdrom"
KERNEL=="sch[0-9]*", GROUP="cdrom"
KERNEL=="pktcdvd[0-9]*", GROUP="cdrom"
KERNEL=="pktcdvd", GROUP="cdrom"

SUBSYSTEM=="scsi_generic|scsi_tape", SUBSYSTEMS=="scsi", ATTRS{type}=="1|8", GROUP="tape"
SUBSYSTEM=="scsi_generic", SUBSYSTEMS=="scsi", ATTRS{type}=="0", GROUP="disk"
KERNEL=="qft[0-9]*|nqft[0-9]*|zqft[0-9]*|nzqft[0-9]*|rawqft[0-9]*|nrawqft[0-9]*", GROUP="disk"
KERNEL=="rawctl", GROUP="disk"
SUBSYSTEM=="raw", KERNEL=="raw[0-9]*", GROUP="disk"
SUBSYSTEM=="aoe", GROUP="disk", MODE="0220"
SUBSYSTEM=="aoe", KERNEL=="err", MODE="0440"

KERNEL=="rfkill", MODE="0644"
KERNEL=="tun", MODE="0666", OPTIONS+="static_node=net/tun"

KERNEL=="fuse", MODE="0666", OPTIONS+="static_node=fuse"

LABEL="default_permissions_end"
tom@tom-Inspiron-1520 ~ $

I don't mind doing sudo to run the scanner, as long as I don't have to open sudo Gimp, etc, and can print. Is there a problem with running scanner as root? If I gave the image to someone else will they be able to open the image owned by root?

xsane 0.998 will not run w/out sudo. Image viewer will not open scanned image w/out sudo. Neither will Gimp.

Will download and install Linux Mint 17-3 32bit to see how it works.
User avatar
xenopeek
Level 24
Level 24
Posts: 24927
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

Re: Scanners

Post by xenopeek »

You can change the ownership of the saved image file back to yourself, before you do anything else with the image file. In your file manager browse to the directory where you have the directory that contains the saved image file. Right-click that directory and select "Open as Root" or "Open as administrator" from the context menu. That should open that directory in a new file manager window with the file manager running as root. Now you can right-click the file, select Properties, go to the Permission tab, and change the file owner and group from root to yourself.

Mind that the above doesn't work on Xfce as Thunar doesn't give you a way to change the file owner. So on Xfce you'll either have to use the terminal as you often do, or you'll have to install a file manager that does have this functionality.

If you always save scanned image files to the same directory it's not that hard to write a script that say runs with some frequency, finds files owned by root, and changes the ownership to you on its own
Image
Cosmo.
Level 23
Level 23
Posts: 17817
Joined: Sat Dec 06, 2014 7:34 am

Re: Scanners

Post by Cosmo. »

You have created additional problems by using commands like sudo simple-scan or sudo gimp. This cries for ownership problems. The general rule is, that any(!) graphical program may only get launched with elevated rights by using the command gksudo! No exception!
borgward
Level 5
Level 5
Posts: 801
Joined: Mon Dec 17, 2012 10:18 pm

Re: Scanners

Post by borgward »

xenopeek wrote:You can change the ownership of the saved image file back to yourself, before you do anything else with the image file. In your file manager browse to the directory where you have the directory that contains the saved image file. Right-click that directory and select "Open as Root" or "Open as administrator" from the context menu. That should open that directory in a new file manager window with the file manager running as root. Now you can right-click the file, select Properties, go to the Permission tab, and change the file owner and group from root to yourself.
I get "You are not the owner, so you cannot change these permissions"
xenopeek wrote:Mind that the above doesn't work on Xfce as Thunar doesn't give you a way to change the file owner. So on Xfce you'll either have to use the terminal as you often do, or you'll have to install a file manager that does have this functionality.
I am running MATE 17-1.
xenopeek wrote:If you always save scanned image files to the same directory it's not that hard to write a script that say runs with some frequency, finds files owned by root, and changes the ownership to you on its own
I could go to the terminal, or write a script as you suggested, but that is just treating the symptom. I did not start this discussion to troubleshoot the scanner problem. I did that in the hardware section. I wanted to point out that this is a common problem that needs to be addressed. Who should be notified that the underlying problem needs to be fixed so that someone can use their scanner as a normal user?
borgward
Level 5
Level 5
Posts: 801
Joined: Mon Dec 17, 2012 10:18 pm

Re: Scanners

Post by borgward »

Cosmo. wrote:You have created additional problems by using commands like sudo simple-scan or sudo gimp. This cries for ownership problems. The general rule is, that any(!) graphical program may only get launched with elevated rights by using the command gksudo! No exception!
I opened xsane with gksudo. The image is still owned by root. I opened Gimp w/gksudo and modified the image and saved it. The image still belongs to root, I don't see different results by using gksudo.
User avatar
Moem
Level 20
Level 20
Posts: 11812
Joined: Tue Nov 17, 2015 9:14 am
Location: The Netherlands
Contact:

Re: Scanners

Post by Moem »

Using gksudo does not fix those problems. It just does not cause them. Once they are there, which seems to be the case, they need to be resolved, and using gksudo does not do that.
People are trying to help you with that in your other thread about xsane.
Image

If your issue is solved, kindly indicate that by editing the first post in the topic, and adding [SOLVED] to the title. Thanks!
Cosmo.
Level 23
Level 23
Posts: 17817
Joined: Sat Dec 06, 2014 7:34 am

Re: Scanners

Post by Cosmo. »

borgward wrote:I opened xsane with gksudo. The image is still owned by root. I opened Gimp w/gksudo and modified the image and saved it. The image still belongs to root, I don't see different results by using gksudo.
Of course the files belong to root, if root creates them. I wrote about additional problems by using sudo, as you did mention twice this and not gksudo here.
chiefjim
Level 5
Level 5
Posts: 929
Joined: Sun Jun 07, 2009 7:26 am
Location: South Texas, USA

Re: Scanners

Post by chiefjim »

What brand of scanner? My Brother MFC-J450 was very difficult to setup until I reread the need to install drivers.

brscan4-0.4.2-1.amd64.deb

Once installed everything is a breeze. Also learned that switching from USB to wireless or vice versa required extra steps.

"NOTE
If you have previously configured the wireless settings of the machine, you must reset the network settings
before you can configure the wireless settings again.
On your machine, press Menu. Press a or b to choose Network. Press OK.
Press a or b to choose Network Reset. Press OK.
Press 1 (Yes) twice to accept the change."
Mint-20 Mate 64 bit
Gigabyte H370M D3H
Intel G3258
Crucial Ballistic Sport 16GB DDR4 2400
4TB HDD Seagate Baracuda 7200rpm
User avatar
richyrich
Level 19
Level 19
Posts: 9056
Joined: Mon May 04, 2009 8:31 pm

Re: Scanners

Post by richyrich »

Looking at your udev.rules I see the group "lp" . Are you a member of the LP group ?
User avatar
xfrank
Level 5
Level 5
Posts: 611
Joined: Sat Nov 24, 2012 6:09 pm
Location: Mexico City
Contact:

Re: Scanners

Post by xfrank »

For me the scanner permission problem for my Brother scanner was solved in this way:

First, find the id of your scanner.
To find out where the brother scanner is on the bus use lsusb. This is one of the problems in the scanimage. The bus is 003 and the device is 002 and not but 5 dev 1 as per scanimage

$ lsusb
Bus 003 Device 002: ID 04f9:60a0 Brother Industries, Ltd**
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
...

To fix the problem, you will need to use the path based on the location of the brother scanner in the lsusb command. In my case it was bus 003 and device 002. Note that if you unplug the USB cable to the scanner and plug it back in the device, you will get a new number and/or bus. (The number return back to 2 when you reboot the PC)

Examples:

$ sudo cd /dev/bus/usb/003
$ sudo chmod 666 002

or just:

$ sudo chmod 666 /dev/bus/usb/003/002

Scanimage need to fix the message when it can not access the scanner to have the right bus and dev number and also tell the user that the problem is a write access problem.

(see: http://askubuntu.com/questions/389636/i ... an2-driver )
Active Distros in my computers: LM19.3 (Mate,Xfce); MXLinux (Xfce); SparkyLinux (Xfce); Manjaro (Xfce)
Post Reply

Return to “Suggestions & New Ideas”