User Account Unable to Execute Commands That Don't Require Root Privileges
Solved
I found the solution to my particular issue and I'll make another post about how to fix this.
Basically, I just installed a package called ntfs-3g which allowed me to access Windows partitions. That was it.
Original Post
My Issue
I'm trying to execute the command cd /mnt which I know for certain it does not need root privileges. However, it says that I cannot execute it as I don't have permission to do so.
Output of cd /mnt
-bash: cd: /mnt: Permission Denied
What I'm running
I'm using mainline arch on the latest kernel (not an lts kernel).
Solutions I've Tried So Far
- Ran
userdeland recreated user withuseraddnumerous times- I've also made sure that I was in the
wheel
- I've also made sure that I was in the
- Started the installation over (twice)
My Search For a Solution
I've tried looking for a solution but nothing relevant comes up. Only how to delete/add users and how to limit privileges. This is now what I'm looking for.
Current Workaround
All I can do to get around this (and I know it's a bad idea) is to run su. I really don't want to keep using it for things I know don't need root privileges.
Possible Fixes So Far
- I've been suggested to try
chmod. Also,ls -lhalists the permissions on the far left. When comparing them on the desktop and my laptop, I can see the difference.
Update
I decided to use Manjaro instead because I got tired of troubleshooting when I had to get work done. In Manjaro, I can mount sdb1 and access it. I tried it with a temporary Arch install on an USB and could not access it (the same problem that prompted this post happened). I mounted my NVME which has Manjaro on it and I could access it without issue.
This leads me to believe that there has to be a package that lets me access Microsoft filesystem partitions. I have a Win10 partition and the 2TB disk may have gotten rolled into being a MS filesystem.
Posted Nov 19, 2020, 2:29 AM UTC · edited
On Linux and some other systems we have what are called Read, Write and Execute permissions. Most likely what's hapenning is that /mnt for some reason only has read permissions granted for root, so no matter what you do you just won't be able to cd into it as you can't read it as a normal user.
You can try to use the chmod tool to change permissions so you can cd into it without root, but I recommend investigating if what I said really is the case and why before doing anything.
I have thought about that. I ran
ls -lhaas my user and the root user to compare what the permission were. They were the same on both. However, I may be looking at it the wrong way, now that I think about it.I will see about your suggestion.
Thank you very much for your quick reply and suggestion!
The permission would be same because "ls -lha" will show all permissions. You need to check who is the owner of the directory and which group is the owner.
Linux Permissions In A Nutshell
The image above might help you understand what they mean.
For you to "cd" into a directory, you need the executable permissions on it.
Thank you for this image. I now see what you're talking about.
I'll keep looking into this!
Thank you for your help. I found out a solution and updated the post.
Thank you for your help. I found out a solution and updated the post.