![우분투 16.04에서 장치 읽기 및 쓰기 권한을 영구적으로 설정하는 방법은 무엇입니까?](https://linux55.com/image/115907/%EC%9A%B0%EB%B6%84%ED%88%AC%2016.04%EC%97%90%EC%84%9C%20%EC%9E%A5%EC%B9%98%20%EC%9D%BD%EA%B8%B0%20%EB%B0%8F%20%EC%93%B0%EA%B8%B0%20%EA%B6%8C%ED%95%9C%EC%9D%84%20%EC%98%81%EA%B5%AC%EC%A0%81%EC%9C%BC%EB%A1%9C%20%EC%84%A4%EC%A0%95%ED%95%98%EB%8A%94%20%EB%B0%A9%EB%B2%95%EC%9D%80%20%EB%AC%B4%EC%97%87%EC%9E%85%EB%8B%88%EA%B9%8C%3F.png)
우분투를 실행하는 임베디드 장치를 사용하고 있습니다.
일반적으로 루트만이 i2c 장치에 대한 읽기 및 쓰기 권한을 갖습니다.
이 명령을 사용하여 일반 사용자(나)에게 i2c r/w 권한을 추가합니다.
sudo chmod 777 /dev/i2c-*
하지만 나는 규칙을 만들고 싶다 udev
. /etc/udev/rules.d/
이라는 파일에 파일을 만들고 그 60-i2c-tools.rules
안에 다음 줄을 넣었습니다.
KERNEL==”i2c-[0-9]*”, MODE=”0660”
그런데 장치를 재부팅하면 I2C 장치에 액세스할 수 없습니다. 권한은 다음과 같습니다.
crwxrwxrwx 1 root root 89, 0 Aug 10 12:59 /dev/i2c-0
crwxrwxrwx 1 root root 89, 1 Aug 10 12:59 /dev/i2c-1
crw------- 1 root root 89, 10 Aug 10 12:59 /dev/i2c-10
crw------- 1 root root 89, 11 Aug 10 12:59 /dev/i2c-11
crwxrwxrwx 1 root root 89, 2 Aug 10 12:59 /dev/i2c-2
crwxrwxrwx 1 root root 89, 3 Aug 10 12:59 /dev/i2c-3
crw------- 1 root root 89, 4 Aug 10 12:59 /dev/i2c-4
crw------- 1 root root 89, 5 Aug 10 12:59 /dev/i2c-5
crw------- 1 root root 89, 6 Aug 10 12:59 /dev/i2c-6
crw------- 1 root root 89, 7 Aug 10 12:59 /dev/i2c-7
crw------- 1 root root 89, 8 Aug 10 12:59 /dev/i2c-8
crw------- 1 root root 89, 9 Aug 10 12:59 /dev/i2c-9
sudo chmod 777 /dev/i2c-*
실행 하고 권한을 다음으로 변경 해야 합니다 .
crwxrwxrwx 1 root root 89, 0 Aug 10 12:59 /dev/i2c-0
crwxrwxrwx 1 root root 89, 1 Aug 10 12:59 /dev/i2c-1
crwxrwxrwx 1 root root 89, 10 Aug 10 12:59 /dev/i2c-10
crwxrwxrwx 1 root root 89, 11 Aug 10 12:59 /dev/i2c-11
crwxrwxrwx 1 root root 89, 2 Aug 10 12:59 /dev/i2c-2
crwxrwxrwx 1 root root 89, 3 Aug 10 12:59 /dev/i2c-3
crwxrwxrwx 1 root root 89, 4 Aug 10 12:59 /dev/i2c-4
crwxrwxrwx 1 root root 89, 5 Aug 10 12:59 /dev/i2c-5
crwxrwxrwx 1 root root 89, 6 Aug 10 12:59 /dev/i2c-6
crwxrwxrwx 1 root root 89, 7 Aug 10 12:59 /dev/i2c-7
crwxrwxrwx 1 root root 89, 8 Aug 10 12:59 /dev/i2c-8
crwxrwxrwx 1 root root 89, 9 Aug 10 12:59 /dev/i2c-9