You are not logged in.

#1 2024-08-08 00:14:24

3ey
Member
Registered: 2024-08-05
Posts: 9

How to get rights to system files

how can I give myself rights so that I can change and delete files that for some reason are not available to me? I need to delete one file that I am not allowed to delete, I apologize for the possibly stupid question

Offline

#2 2024-08-08 00:29:08

loqs
Member
Registered: 2014-03-06
Posts: 18,894

Re: How to get rights to system files

What are the current ownership and access permissions for that file? What have you tried so far?

Offline

#3 2024-08-08 00:57:33

cryptearth
Member
Registered: 2024-02-03
Posts: 2,167

Re: How to get rights to system files

that question hints you're new to linux (or modern computing in general) - Arch maybe not the best distro for you to start learning

Offline

#4 2024-08-08 08:52:31

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,834

Re: How to get rights to system files

I need to delete one file that I am not allowed to delete

Leaving aside competency questions, that sounds like an https://en.wikipedia.org/wiki/XY_problem and potential for desaster.
What file do you "need" to delete and why don't you control the path it resides in?

If the answer starts w/ "/sys/…" or "/proc/…" or "/dev/…" you can abandon that approach immediately and if you don't have root access to the system but would like to delete /etc/shadow while the system admin emphatically disagrees, we're not helping you with criminal efforts.

Online

#5 2024-08-08 09:49:22

cryptearth
Member
Registered: 2024-02-03
Posts: 2,167

Re: How to get rights to system files

seth wrote:

would like to delete /etc/shadow

is that even possible?
isn't shadow one of those files even root has only somewhat limited access to as it's protected by the kernel?

Offline

#6 2024-08-08 12:39:23

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: How to get rights to system files

cryptearth wrote:
seth wrote:

would like to delete /etc/shadow

is that even possible?

# rm /etc/shadow                                                                    
rm: remove regular file '/etc/shadow'? y
removed '/etc/shadow'
# stat /etc/shadow                                                                  
stat: cannot statx '/etc/shadow': No such file or directory
1#

Seems fine.

EDIT: it won't let me login again though, for obvious reasons.

Last edited by Head_on_a_Stick (2024-08-08 12:40:23)


Jin, Jîyan, Azadî

Offline

#7 2024-08-08 13:01:33

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,834

Re: How to get rights to system files

EDIT: it won't let me login again though, for obvious reasons.

You'll have to reboot in single user mode … (or restore it from the open root shell)

@cryptearth, what kernel how and why?
You could theoretically safe-guard specific files in the filesystem but if the root is allowed to randomly write the file, what's the point of that? You could obviously just blank it, achieves the same.

Online

Board footer

Powered by FluxBB