Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

i want use a symbolic link from usb printers but i can't write to this device:

$ ls -l /dev/usb/lp*
crw-rw---- 1 root lp 180, 0 jun 25 14:17 /dev/usb/lp0
crw-rw---- 1 root lp 180, 1 jun 25 14:17 /dev/usb/lp1
crw-rw---- 1 root lp 180, 2 jun 25 14:17 /dev/usb/lp2

How i can change this permission? to 666?

And i create the symbolic link in:

sudo gedit /lib/udev/rules.d/70-printers.rules

This is a content:

# Low-level USB device add trigger
ACTION=="add", SUBSYSTEM=="usb", ATTR{bInterfaceClass}=="07", ATTR{bInterfaceSubClass}=="01", TAG+="udev-configure-printer", RUN+="udev-configure-printer add %p"
# Low-level USB device remove trigger
ACTION=="remove", SUBSYSTEM=="usb", ENV{ID_USB_INTERFACES}=="*:0701*:*", RUN+="udev-configure-printer remove %p"

# printer1
SUBSYSTEM=="usb", ATTRS{serial}=="3uL8tBCQUl2hMhoY12Vf", SYMLINK+="caliente"
# printer2
SUBSYSTEM=="usb", ATTRS{serial}=="JGHE24ikKU7plwR8x3c6", SYMLINK+="bar"
# printer3
SUBSYSTEM=="usb", ATTRS{serial}=="xVc0EQQd3nZzq6ziv8SS", SYMLINK+="fria"

The symbolics links are created:

ls -l /dev/bar 
lrwxrwxrwx 1 root root 15 jun 25 14:12 /dev/bar -> bus/usb/003/002

But when i try print in command line i get this:

echo "hi" >> /dev/bar
bash: /dev/bar: Permission denied

I hope can help me!!!

share|improve this question
    
Well to change crw-rw---- 1 root lp 180, 0 jun 25 14:17 /dev/usb/lp0, i go to sudo gedit /lib/udev/rules.d/50-udev-default.rules to the line KERNEL=="lp[0-9]*", GROUP="lp", MODE="0777" and add the last part MODE="0777" and now i got ls -l /dev/usb/lp* crwxrwxrwx 1 root lp 180, 0 jun 25 20:48 /dev/usb/lp0 but i need the symbolic link permission to be persistence with the printer name. –  elgastelum Jun 26 at 3:00

1 Answer 1

In Xubuntu 14.04 you need create a rules file for printers in /etc/udev/rules.d/

$ sudo nano 90-printers.rules

In this file add the follow code:

ACTION=="remove", GOTO="persistent_printer_end"

# This should not be necessary
#KERNEL!="lp*", GOTO="persistent_printer_end"

SUBSYSTEMS=="usb", IMPORT{builtin}="usb_id"
ENV{ID_TYPE}!="printer", GOTO="persistent_printer_end"

ENV{ID_SERIAL}=="?*", SYMLINK+="lp/printers/$env{ID_BUS}-$env{ID_SERIAL}"

#IMPORT{builtin}="path_id"
#ENV{ID_PATH}=="?*", SYMLINK+="lp/by-path/$env{ID_PATH}"

LABEL="persistent_printer_end"

Then you can see the new and persistent symbolic links in the follow path:

$ ls -l /dev/lp/printers
lrwxrwxrwx 1 root root 13 jul 21 14:42 usb-Jolimark_USB_Printer_JGHE24ikKU7plwR8x3c6 -> ../../usb/lp2
lrwxrwxrwx 1 root root 13 jul 21 14:42 usb-Jolimark_USB_Printer_MQrvZsOINprsF6dIEor9 -> ../../usb/lp0
lrwxrwxrwx 1 root root 13 jul 21 14:42 usb-Jolimark_USB_Printer_xVc0EQQd3nZzq6ziv8SS -> ../../usb/lp1

This point to the followind path:

$ ls -l /dev/usb/lp*
crw-rw---- 1 root lp 180, 0 jul 21 14:42 /dev/usb/lp0
crw-rw---- 1 root lp 180, 1 jul 21 14:42 /dev/usb/lp1
crw-rw---- 1 root lp 180, 2 jul 21 14:42 /dev/usb/lp2
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.