odd permission required on /dev/video0

Discussions related to the 1.36.x series of ZoneMinder
Post Reply
fluffykeith
Posts: 14
Joined: Wed Jun 07, 2023 3:11 pm

odd permission required on /dev/video0

Post by fluffykeith »

Hi
I had to reinstall my Ubuntu machine and am trying to get back where I was with zm.

I had
"Failed to open video device /dev/video0: Permission denied"

I had already done usual set owner and permissions and also have a rule in /ect/udev/rules.d containing.
SUBSYSTEM=="video4linux", ACTION=="add", RUN+="/bin/chmod 644 /dev/$name"

ls -l for video0 gave.
crw-rw-r--+ 1 root video 81, 0 Sep 30 09:43 video0

Which I think was how it should be and was in the previous setup.

However, permission denied :( . BUT if is set the owner to www-data it all bursts into life.
crw-rw-r--+ 1 www-data video 81, 0 Sep 30 09:43 video0

The question is - have I configured something else incorrectly to warrant this change in owner for /dev/video0 and there is a lurking issue elsewhere?

If so please can you point me in the right direction.
Thanks
User avatar
iconnor
Posts: 3362
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: odd permission required on /dev/video0

Post by iconnor »

TYpically in ubuntu /dev/video* are owned by group video. So if you just add www-data to the video group, it just works.
Magic919
Posts: 1381
Joined: Wed Sep 18, 2013 6:56 am

Re: odd permission required on /dev/video0

Post by Magic919 »

I think it’s normal to add www-data to the video group.
-
fluffykeith
Posts: 14
Joined: Wed Jun 07, 2023 3:11 pm

Re: odd permission required on /dev/video0

Post by fluffykeith »

Thanks for the replies.

I 'm not much of a wiz on linux.
I did "getent group" and for video it returned.
video:x:44:www-data,keith

Now, if I change the owner to keith, I still get the video stream now that it's started but I also get the permission denied as it is trying to select the format. I presume by me not being the owner that I don't have write access, but I am a member of the video group so I should have the group permissions which happen to be the same as the owner.

crw-rw-r--+ keith video 81, 0 Sep 30 13:54 /dev/video0

setting permissions to 777 doesn't fix it either.

Am I missing something? Is there some other permission rather than the file access?
Post Reply