LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices


Reply
  Search this Thread
Old 03-19-2024, 06:35 PM   #1
mattdawolf
Member
 
Registered: Aug 2018
Posts: 34

Rep: Reputation: Disabled
character device permissions as non-root


What is the best way to permanently chown everything in /dev/vfio as my non-root user?
 
Old 03-19-2024, 08:58 PM   #2
GlennsPref
Senior Member
 
Registered: Apr 2004
Location: Brisbane, Australia
Distribution: Devuan
Posts: 3,657
Blog Entries: 33

Rep: Reputation: 283Reputation: 283Reputation: 283
After you chown, do chattr +i (immutable).

do chattr -i to reverse the immutable flag. see with lsattr

I hope It's obvious the user and filename are required.

I've not tried this in /dev...
 
Old 03-20-2024, 08:24 AM   #3
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,779

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
Quote:
Originally Posted by GlennsPref View Post
After you chown, do chattr +i (immutable).

do chattr -i to reverse the immutable flag. see with lsattr

I hope It's obvious the user and filename are required.

I've not tried this in /dev...
That's going to be "permanent" just until the next reboot, at which time the entire /dev devtmpfs is recreated. The only way I know of to change those permissions is by overriding the rules 50-udev-default.rules and 91-vfio.rules in /usr/lib/udev/rules.d. If you decide to do the rules override, put the override file(s) in /etc/udev/rules.d so that they won't be replaced in the next update.

Last edited by rknichols; 03-20-2024 at 08:31 AM.
 
1 members found this post helpful.
Old 03-20-2024, 04:42 PM   #4
GlennsPref
Senior Member
 
Registered: Apr 2004
Location: Brisbane, Australia
Distribution: Devuan
Posts: 3,657
Blog Entries: 33

Rep: Reputation: 283Reputation: 283Reputation: 283
I thought there was a really good reason why I had never done that in /dev
 
  


Reply

Tags
char *, dev, vfio



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how can i write to a root:root 750 file with a non-root user? Droa Linux - Newbie 1 05-14-2012 07:49 PM
Difference between Block device and Character device quartslove Fedora 2 11-29-2006 08:50 PM
Monitoring traffic tool/web based(non-cgi?)/non-SNMP/low CPU usage/non-real time pe2338 Linux - Networking 3 05-04-2006 01:00 PM
mounting hardrive via non-root and using it via non-root Paridoth Mandriva 1 11-03-2004 05:55 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora

All times are GMT -5. The time now is 01:59 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration