So I just setup a new TrueNas Scale server but I am unable to use any commands in the shell in the webui. I can run commands directly on the system but not on the web interface. In the web interface I am seeing the user showing as admin instead of root like the documentation shows (Assuming because when setting up I chose to use admin instead of root to log in) and when I try and run a command like smartctl and it says command not found.
Any help would be appreciated as it is really frustrating to not be able to use the shell.
This is because some administrative programs like
smartctl is located in
/usr/sbin instead of the usual
/usr/bin and as such, it is only recognized as a valid command for the
root user. Hint: the "s" in sbin stands for "super", so this is ONLY included in the
PATH of the "super user (aka root)" and NOT regular users
PATH environment variable. You can check this by simply executing
echo $PATH
What does this mean? Well, this means that you can execute
smartctl in two ways:
- Become a super user with
sudo su -
and then execute smartctl
OR
- Just straight up do
sudo /usr/sbin/smartctl
from your normal user account.
I'd probably do the former if you have to do a bunch of general administrative tasks as it's less tedious or (what I and most BSD users actually prefer) just keep the root account active as you've already done.