I want to give access to serial port /dev/ttyACM0
. How to execute the "sudo chmod 777 /dev/ttyACM0
" command from shell script ?
Asked
Active
Viewed 9,211 times
4
1 Answers
9
Giving 777
permission to a file is not at all recommended. Since you want to give access to the Serial port, you have to add the user to the dialout
group
sudo usermod -a -G dialout <username>
Now, no permission will be asked while accessing the serial port.
Note that this solution will also work for uploading code to Arudino boards in Arduino IDE or Serial Monitor in Ubuntu.

Tejas Lotlikar
- 2,945
- 5
- 17
- 26
-
3THIS. The correct method is to add the user to the group. That is why dialout exists as a group. – Rinzwind Dec 04 '19 at 14:23
774
or770
? Never give777
permissions at a folder/file, you would create a huge security breach into your OS – damadam Dec 04 '19 at 13:51