Solved Weird permission problem for /usr/src/bin

Hi, fellas.

I am having a very weird problem with my fresh FreeBSD VM. Second day installed and I just spotted the problem now: I have no permission to use ANY binary in /usr/src/sbin

Those are the steps I did before giving up:

1-Installed zsh and chsh it for both my normal user and root. Configured it.
2-Tried to execute ping, couldn't find it. Realized I forgot to add /usr/src/sbin on my PATH, so added it: this is on my .zshrc now:
path=(/bin /usr/bin /usr/local/bin /usr/src/sbin /usr/sbin .)
3-I don't get permission to execute any command under that directory as normal user OR root:
# zsh: permission denied: ping

4- ls -la returns me permission value of 755 for all binaries, so root has wrx, group and others have read/write permissions
5- all binaries are owned by root:wheel. Normal user is already in the wheel group. Root has nothing weird on its permissions (wheel, operator)
6- I can execute any binary on other routes as far as I know, I just have problems with /usr/src/sbin. Yesterday I executed shutdown no problems, so it is something that happened today.
 
Installed zsh and chsh it for both my normal user and root. Configured it.
Do NOT change root's shell. You will have problems after doing a version upgrade. Set it back to csh(1).

I have no permission to use ANY binary in /usr/src/sbin
There are no binaries there. That directory contains the source code for building FreeBSD. There's nothing for you to execute there.

ls -la returns me permission value of 755 for all binaries, so root has wrx, group and others have read/write permissions
They're directories, not binaries. Directories have execute permissions or else you will not be able to cd(1) into them.
 
Thanks a lot for the reply!

I reverted root to csh and yep, sure enough I can run all the problematic binaries with no problem

And yeah, this was a stupid mistake. I was wondering why a folder called /src will have binaries, but when I did a whereis ping it returned /usr/src/sbin/ping. I am an idiot and didn't realize the prefix "d" when doing a ls -l

I guess today I learnt a couple of things.
 
Vladimir1922 another remark on that:

You should always use a shell from base (which is either the very rudimentary POSIX shell /bin/sh or the included C-Shell) for your superuser account. This makes sure you don't have additional PITA recovering from a situation where something with ports/packages is broken.

Still, you might want to use a different shell for root as well. For that, FreeBSD offers a second superuser account "toor" (root spelled backwards). You can activate it by setting a password for it with passwd toor. Then you can set a different shell for ONE of the root accounts. It's common practice to use "toor" for that, but it also works the other way around, the only thing that's important is having one root login with a shell from base.

That said, of course zsh should also find every binary, so something was broken with your zsh configuration.
 
Back
Top