I have a file /dev/ttyS0. And every time I boot, its file permissions are changed to default (unwritable) by the system. So, I have to run a chmod command every time I boot-up. How can I change its file permission permanently?
Asked
Active
Viewed 4,147 times
1
Eliah Kagan
- 116,445
- 54
- 318
- 493
suba
- 21
- 1
- 2
-
What does it means "unwritable by the system"? Please show the output of `ls -l /dev/ttyS0`. – enzotib Dec 14 '11 at 08:15
-
Why does this down vote? we use linux, isn't that mean we have freedom to set what chmod we want. – GusDeCooL May 09 '13 at 19:46
-
@enzotib Every time reboot, the chmod back to 660 – GusDeCooL May 09 '13 at 19:47
-
Here may answer you question: http://askubuntu.com/questions/58119/changing-permissions-on-serial-port – GusDeCooL May 09 '13 at 19:49
-
@GusDeCooL - Sure do what you want. Best thing abut open source, if you break it you get to keep both pieces. – Panther Apr 14 '15 at 01:49
-
suba - what did you do to get into this problem ? – Panther Apr 14 '15 at 01:49
1 Answers
2
Changing the file permission is not a good idea. I think /dev/ttyS* are designed to be accessed by user space applications, so you dont need to make it accessible to everybody. Instead you should give permission to use the serial ports to users that need access. If I am not wrong, you can do this by adding your user to the group uucp which can be done by running the following command in the terminal:
usermod -aG uucp <you_user_name>
If this does not solve your issue, try posting a bit more details on what you are doing. What device are you accessing and explaining how are you writing to it, and perhaps providing some code snippets will help give more specific answer.
Aras
- 819
- 4
- 11
- 28