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 communityAfter 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?
you 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.
– JdeBP
Jan 17 '17 at 12:45
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
– Hrvoje T
Jan 17 '17 at 22:44
ls /dev/ttyS0
? – ctrl-alt-delor Jan 17 '17 at 10:51/dev
subtree is not persistent, but it is generated at boot byudev
. – AlexP Jan 17 '17 at 10:58crw-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 bash – Hrvoje T Jan 17 '17 at 11:01dialout
, it is also more secure. – ctrl-alt-delor Jan 17 '17 at 11:02