You are not logged in.

#1 2022-06-24 10:28:51

rafaellancas
Member
Registered: 2022-05-31
Posts: 78

[SOLVED] Newbie struggles with permissions"

Somehow, I broken my terminal and simple commands like "rm" or "cd" are not working properly anymore. For example, I need to remove a folder, but it keeps giving me a lot of bugs no matter what.

[rafael@pc [Linux]]$ rm Flotsam
rm: cannot remove 'Flotsam': Is a directory
[rafael@pc [Linux]]$ rm -f Flotsam
rm: cannot remove 'Flotsam': Is a directory
[rafael@pc [Linux]]$ rm -d Flotsam
rm: cannot remove 'Flotsam': Directory not empty
[rafael@pc [Linux]]$ sudo rm -d Flotsam/
[sudo] password for rafael: 
rm: cannot remove 'Flotsam/': Directory not empty
[rafael@pc [Linux]]$ sudo rm -r Flotsam/
rm: cannot remove 'Flotsam/': Directory not empty
[rafael@pc [Linux]]$ sudo rm -f Flotsam/
rm: cannot remove 'Flotsam/': Is a directory
[rafael@pc [Linux]]$ sudo rm -r Flotsam/
rm: cannot remove 'Flotsam/': Directory not empty
[rafael@pc [Linux]]$ sudo rm -r Flotsam/
rm: cannot remove 'Flotsam/': Directory not empty
[rafael@pc [Linux]]$ sudo rm -d Flotsam/
rm: cannot remove 'Flotsam/': Directory not empty
[rafael@pc [Linux]]$ sudo rm -rf Flotsam/
rm: cannot remove 'Flotsam/': Directory not empty
[rafael@pc [Linux]]$ man rm
bash: man: command not found
[rafael@pc [Linux]]$ sudo rm -rf Flotsam/
rm: cannot remove 'Flotsam/': Directory not empty
[rafael@pc [Linux]]$ sudo rm -f Flotsam/
rm: cannot remove 'Flotsam/': Is a directory
[rafael@pc [Linux]]$ 

Like, what am I missing here? I tried all the flags with "rm", with or without sudo and nothing seems to work. It's really annoying.

Last edited by rafaellancas (2022-06-29 03:04:24)

Offline

#2 2022-06-24 13:01:11

josep
Member
From: Peru
Registered: 2022-06-06
Posts: 22

Re: [SOLVED] Newbie struggles with permissions"

Have you tried

whereis rm

or

whereis man

Last edited by josep (2022-06-24 13:15:47)

Offline

#3 2022-06-24 13:15:54

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,523
Website

Re: [SOLVED] Newbie struggles with permissions"

And how is this a broken terminal?  Please edit your post and give a meaningful title.  Then provide some actual information: what's in "Flotsam", what are the permisions (e.g., `stat Flotsam` and `stat Flotsam/*`).


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#4 2022-06-24 13:19:53

seth
Member
Registered: 2012-09-03
Posts: 51,056

Re: [SOLVED] Newbie struggles with permissions"

bash: man: command not found

https://archlinux.org/packages/core/x86_64/man-db/

mount

Offline

#5 2022-06-29 03:03:44

rafaellancas
Member
Registered: 2022-05-31
Posts: 78

Re: [SOLVED] Newbie struggles with permissions"

Trilby wrote:

And how is this a broken terminal?  Please edit your post and give a meaningful title.  Then provide some actual information: what's in "Flotsam", what are the permisions (e.g., `stat Flotsam` and `stat Flotsam/*`).

I solved it by booting a live ubuntu and deleting it on GUI. I don't understand how permissions work on linux, but I think that being root does not necessarily solve everything. Well, at least I found out a nice file manager that opens on the CLI called MC, it eases de pain a little. As for editing, I will put something like "newbie struggles with permissions". As for the man package, thank you so much, it sure will help learning how things work on linux!

Thank you all for all your help!

Offline

#6 2022-07-06 02:31:29

dawnofman
Member
Registered: 2019-07-26
Posts: 140

Re: [SOLVED] Newbie struggles with permissions"

rafaellancas wrote:
Trilby wrote:

And how is this a broken terminal?  Please edit your post and give a meaningful title.  Then provide some actual information: what's in "Flotsam", what are the permisions (e.g., `stat Flotsam` and `stat Flotsam/*`).

I solved it by booting a live ubuntu and deleting it on GUI. I don't understand how permissions work on linux, but I think that being root does not necessarily solve everything. Well, at least I found out a nice file manager that opens on the CLI called MC, it eases de pain a little. As for editing, I will put something like "newbie struggles with permissions". As for the man package, thank you so much, it sure will help learning how things work on linux!

Thank you all for all your help!

My two-cents:

- do not use the console unless you're proficient with the tools
- and/or you are on the quest to understand them (if needed) (if wanted)
- and/or you are allocating time to understand the way things work on linux, on the console I mean

Because; if not, you're making a recipe for disaster, which brings me to my second two-cents (make it four-cents):

- if, at the very least, you are not familiar with how the things works on the console, or you are not comfortably with it for whatever reasons, DO NOT use arch, choose something more friendly to begin with; be it ubuntu, mint, even manjaro, but stay away from the console unless you are on path to learn it, and then, when you managed to understand the basics, and if you still want to, reinstall arch and give you a second try.

Offline

#7 2022-07-06 11:59:15

rafaellancas
Member
Registered: 2022-05-31
Posts: 78

Re: [SOLVED] Newbie struggles with permissions"

Thank you for your post.

I'm trying to learn how to work on the console, but I still strugle with permissions. I have no idea why my system refuses to accept basic commands, even if I am root (with su and my password, which is the same as the root just to avoid permission bugs). This problem with removing folders, for example, since, in theory, the system does that to protect itself, but, at the same time, things work on GUI but refuse to work on CLI for whatever reason.

Offline

#8 2022-07-06 17:40:46

dawnofman
Member
Registered: 2019-07-26
Posts: 140

Re: [SOLVED] Newbie struggles with permissions"

rafaellancas wrote:

This problem with removing folders, for example, since, in theory, the system does that to protect itself, but, ...

I will tell you about some incident I had many years ago when I started to use linux and, coming from the Windows world, have to learn it from scratch. Everything seemed alien, to be quite frankly more alien than expected. and everything security-related comes to mind. At the time I took it for granted that every OS out there handled security the way Windows handled it, I am not referring to the inner details, I am talking of the end-user appreciation of that handling, meaning, for example, Windows prevented me (with a common user account) to modify anything critical for its operation: I can not add/remove users, I can not alter anything critical system-related like lots of registry settings, and I cannot "see/view" what other users settings/content are unless they explicitly allow me to, etc etc etc; which to me seemed totally natural.

Fast-forward to my first encounter with linux:

- a common user can cat /etc/passwd and /etc/group
- a common user can cat almost everything system-critical (but in plenty of situations not modify it unless sudo of course)
- almost all distros use a default umask 022 meaning whatever you create as a common user is visible to everyone unless you manually restrict it to (I should have expected the other way around but it was many many months until I started to research topics like umask permissions etc etc; these days the first thing I do while installing is setting UMASK=077)
- this default umask (in many linux distros) is defined/overrided a lot of times in a lot of places (PAM, /etc/passwd geckos field, BASH profiles, other shell profiles, even system-wide profiles and then again on user-specific profiles) upon booting and finally giving control to the user (it took me many hours to clean-up my system to keep just one instance of the UMASK definition; furthermore, distros like manjaro override the UMASK you set, in manjaro a cleaned-up UMASK behaves as expected under the native console but when you switch to the GUI is 022 once again)

What really amazed me back then was the amount of stuff that was world-readable; ie: 755

Of course as time passed by I learned the different approaches of both OSs; one being tool-related (UNIX/linux) and the other being API related with all that those approaches will later imply for the common user.

Bottom line: arch-linux being derived/based from what is called linux-from-scratch won't do anything to take care of itself as you probably expect and I expected back then. There are other distros that place a security layer on top of this called SEL-linux (which probably you could install in arch too) and things like polkit (which you surely can install in arch and is required for GUI environments) which add, let's call it, safety-checks for almost everything you try to do to the system. There surely be a lof of people here that can explain you these topics with far more knowledge than I am able to, furthermore, they can explain you the why's.

Back to my anecdotal incident: I was trying to do a chmod on some files in a directory under /, lets call it /whatever, which contained some dot-prefixed file names; eg: .fileone .filetwo etc. I was trying to secure those files for me only; ie: 700 because I didn't learn yet of default umask setting which still was 022. Doing chmod 700 * didn't work because * ignores dot-prefixed filenames. So I instead did chmod 700 \.* or something like that I don't remember exactly what. But, in the end this chmod operated on the . and .. folders thus altering everything on root. It was quite a time until I figured out what happened. Lots of things ended working as expected, commands not found etc etc etc. In the end I reinstalled arch because fixing it proved too much for me back then. So no, the system won't take care of itself ... not to mention when you are logged with root or you are in the wheel group or in the sudo group.

Something I did see back then was something like:

"beware of what you type" in the console

And good advice was indeed !

Last edited by dawnofman (2022-07-06 17:45:47)

Offline

Board footer

Powered by FluxBB