After every reboot I have to set chmod o+rw /dev/ttyS0
to be able to print to my POS printer via serial port in bash
.
Is it possible to save permissions and also baud rate, bits, stop bit and parity after the device is closed?
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.
Sign up to join this communityyou can check the group owner of /dev/ttyS0 with:
ls -l /dev/ttyS0
and then add your user in this group:
usermod -a -G {group-name} username
wheel
. This hasn't answered what the questioner asked about line speed and framing, by the way.
useradd
is for a new user. I am an existing user. I have to use sudo usermod -a -G dialout my_username
. Then I can confirm it with the command groups my_username
. I just found this because useradd
didn't work
ls /dev/ttyS0
?/dev
subtree is not persistent, but it is generated at boot byudev
.crw-rw---- 1 root dialout 4, 64 Sij 17 09:15 /dev/ttyS0
after boot and then I change it tocrw-rw-rw- 1 root dialout 4, 64 Sij 17 09:15 /dev/ttyS0
that I can print from bashdialout
, it is also more secure.