Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: SSH and USB

Hybrid View

  1. #1
    Join Date
    Apr 2008
    Beans
    114

    SSH and USB

    Hello !
    I've two computers running 12.04 LTS.
    One called tower has an USB scanner (Epson 2450) attached. The other, a laptop.
    On the tower computer to use the scanner I open a terminal and launch vuescan scanning software by using /opt/Vuescan/vuescan.
    Yesterday, my wife was using the tower computer. Instead of lockin her session and opening a new one, I decided to use the laptop. So I ran, on a terminal on the laptop :ssh -X tower.
    Then I typed /opt/Vuescan/vuescan and the software complained that there where no scanner attached it can open.
    So I checked dmesg and lsusb to see that the scanner was actually here.
    I then modified the X settings on the laptop and ran on the tower the software as root (sudo su -) then set the DISPLAY correectly and ran /opt/Vuescan/vuescan to see that, now, the scanner was here and that the software was apt to use it.

    Question :
    Why can I access the usb scanner when I ran "Application -Accessories -Terminal " and not when I use ssh -X <machine> ? As far as I know, I use the same credentials, and the same devices/access methods ?


    Many thanks in advance for your help and advice !

  2. #2
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    12,547
    Distro
    Lubuntu 14.04 Trusty Tahr

    Re: SSH and USB

    I don't use "vuescan", but I suspect this is a group permissions issue. Check that you are in the group (id) that the scanner device in /dev/ is. Also make certain that the /dev/{scanner} allows group "rw" permissions.

    If you used sudo -s instead of sudo -i, then you would have retained your ssh -X DISPLAY settings. man sudo explains all.

    BTW, i use gscan2pdf to scan documents. Reasonable OCR (multiple methods) and conversion to many different formats built into the GUI. Of course, it uses multiple, proven, F/LOSS tools under the covers.

  3. #3
    Join Date
    Apr 2008
    Beans
    114

    Re: SSH and USB

    Hello !
    Thanks for your answer.
    But, how do you explain that the whole thing works when I start the shell using the applications menu and not while using ssh -X to connect to the machine ? I retain the same identity, such the same rights both ways... Or is the graphical interface doing something unclear and not done by the login process ?

  4. #4
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    12,547
    Distro
    Lubuntu 14.04 Trusty Tahr

    Re: SSH and USB

    Quote Originally Posted by georgesgiralt View Post
    Hello !
    Thanks for your answer.
    But, how do you explain that the whole thing works when I start the shell using the applications menu and not while using ssh -X to connect to the machine ? I retain the same identity, such the same rights both ways... Or is the graphical interface doing something unclear and not done by the login process ?
    I cannot explain that - I do not use the GUI. If you specified the exact GUI you are using and OS, then someone else _might_ be able to help.
    It could be a "feature" of vuescan too. Commercial software often does things like this to prevent unlicensed uses.
    Last edited by TheFu; March 6th, 2013 at 02:26 PM. Reason: s/It/If/

  5. #5
    Join Date
    Nov 2008
    Location
    Lleida, Spain
    Beans
    1,157
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: SSH and USB

    Don't know where is the problem, but
    Why don't you use sane to create a network scanner?
    Look "Sharing a Scanner Over a Network" in https://help.ubuntu.com/community/ScanningHowTo

  6. #6
    Join Date
    Apr 2008
    Beans
    114

    Re: SSH and USB

    The GUI is Gnome 2D no effects. The version is 12.04 LTS. And I've checked with Vuescan team, it's not vuescan...
    All software (except vuescan of course) come from the standard Ubuntu repositories and the software are kept up to date.

  7. #7
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    12,547
    Distro
    Lubuntu 14.04 Trusty Tahr

    Re: SSH and USB

    Quote Originally Posted by georgesgiralt View Post
    The GUI is Gnome 2D no effects. The version is 12.04 LTS. And I've checked with Vuescan team, it's not vuescan...
    All software (except vuescan of course) come from the standard Ubuntu repositories and the software are kept up to date.
    • What command does the menu run?
    • Can you run that exact command in an ssh -X session? Does it work or not? Any error messages?
    • What are the device permissions for the scanner in /dev/?
    • Is your userid in the correct group?
    • Running as root may reset permissions for some files and config files.

  8. #8
    Join Date
    Jan 2011
    Beans
    193

    Re: SSH and USB

    I also think it is a permissions issue. You could try as a test the same, on the laptop run a ssh to the tower and start the vuescan.
    But when no-one has logged in on the tower. It must be possible to do what you want, because as root it works. And root, as you already saw, has a lot more permissions then a regular user. My guesss, if someone logged in on the tower, all devices become owened by that user.
    So you could also test, login on the tower, ( all devices are yours ) and then log in from the laptop and run vuescan.
    It isn't an X problem, then it would not run as root either. This also confirms, your vuescanner is X-Display aware.

    Edit, you could easily see who owns the scanner by ls -l /dev/{Scandevice}
    Last edited by kuifje09; March 6th, 2013 at 03:26 PM.

  9. #9
    Join Date
    Jan 2011
    Beans
    193

    Re: SSH and USB

    I have tried the same as you are using ( even an epson 2400 )

    Which user is logged in is not an issue, mabe when he/she is using the scenner

    When the remote user is trying to use the scanner, that user has to be allowed to use the scanner ( user profiles )
    Then it must be possible to do what you want. ( I tested it with scanimage -x 100 -y 100 --format=tiff >out.tiff )

    The user logged in local had uid 1000 and the remote had 1001. Have a look at the permissions , menu-Other,user-groups.
    Dont forget , its about the numbers, not the names.

    update : you can check local and after the ssh.... with ls -l /dev/bus/usb/002/002 ( in my case ) and getfacl /dev/bus/usb/002/002
    Exact path could be found in dmesg after plugging the scanner.
    Last edited by kuifje09; March 6th, 2013 at 04:25 PM.

  10. #10
    Join Date
    Apr 2008
    Beans
    114

    Re: SSH and USB

    So,
    I've played a bit with this :
    My wife is connected to the tower.
    I do an "ssh -X tower" from the laptop and got a shell with my ID :
    Code:
    georges@tower:~$ id
    uid=1000(georges) gid=1000(georges) groups=1000(georges),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),109(lpadmin),124(sambashare)
    georges@tower:~$
    Then I started the scanner :
    Code:
    georges@tower:~$ lsusb
    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
    Bus 001 Device 003: ID 2001:f103 D-Link Corp. DUB-H7 7-port USB 2.0 hub
    Bus 002 Device 002: ID 046d:c30a Logitech, Inc. iTouch Composite
    Bus 002 Device 003: ID 046d:c00e Logitech, Inc. M-BJ58/M-BJ69 Optical Wheel Mouse
    Bus 001 Device 005: ID 04b8:0112 Seiko Epson Corp. Perfection 2450
    georges@tower:~$ ll /dev/bus/usb/001/005
    crw-rw-r--+ 1 root root 189, 4 mars   6 19:07 /dev/bus/usb/001/005
    georges@tower:~$getfacl /dev/bus/usb/001/005
    getfacl: Removing leading '/' from absolute path names
    # file: dev/bus/usb/001/005
    # owner: root
    # group: root
    user::rw-
    user:nicole:rw-
    group::rw-
    group:scanner:rw-
    mask::rw-
    other::r--
    
    georges@tower:~$
    Then, I locked my wife's session and logged in on the tower. Just log-in. Done nothing.
    Guess what ?
    Code:
    georges@tower:~$ getfacl /dev/bus/usb/001/005
    getfacl: Removing leading '/' from absolute path names
    # file: dev/bus/usb/001/005
    # owner: root
    # group: root
    user::rw-
    user:georges:rw-
    group::rw-
    group:scanner:rw-
    mask::rw-
    other::r--
    
    georges@tower:~$ id
    uid=1000(georges) gid=1000(georges) groups=1000(georges),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),109(lpadmin),124(sambashare)
    georges@tower:~$
    The rights on the shell given by ssh have changed....
    What does the session manager ? Why ? Why this action is not made *also* by the pam system when I log-in with ssh ???
    All your help will be appreciated !
    P.S. : If I log out from the tower and let the locked session live it's life, I get this for the usb device file :
    Code:
    georges@tower:~$getfacl  /dev/bus/usb/001/005
    getfacl: Removing leading '/' from absolute path names
    # file: dev/bus/usb/001/005
    # owner: root
    # group: root
    user::rw-
    user:lightdm:rw-
    group::rw-
    group:scanner:rw-
    mask::rw-
    other::r--
    
    georges@tower:~$
    Last edited by georgesgiralt; March 6th, 2013 at 07:28 PM. Reason: Addenda..

Page 1 of 2 12 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •