Can't do anything in the shell

Minemac2

Dabbler
Joined
Jul 16, 2019
Messages
10
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.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Yeah, iX had the bright idea to allow (or encourage, or before long force) non-root admin logins, but didn't bother to make them actually work--but I'd thought it was supposed to be improved with 22.12.1. Which version of SCALE are you using?
 

Minemac2

Dabbler
Joined
Jul 16, 2019
Messages
10
Yeah, iX had the bright idea to allow (or encourage, or before long force) non-root admin logins, but didn't bother to make them actually work--but I'd thought it was supposed to be improved with 22.12.1. Which version of SCALE are you using?
Looks like I am on 22.12.0. I see I have the update available so I will try that and see if it works. thanks!
 

Minemac2

Dabbler
Joined
Jul 16, 2019
Messages
10
Looks like after the update I still have the same issue. Am I best off trying to reinstall and use root as the login?
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,977
Looks like after the update I still have the same issue. Am I best off trying to reinstall and use root as the login?
No you're best off using a proper SSH client and running your commands from there.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Anyone tried sudo su -, yet?
 

Minemac2

Dabbler
Joined
Jul 16, 2019
Messages
10
I went ahead and reinstalled and just used root as the user for now. Probably try switching again later down the road to see if it is working yet.

Thanks for the help everyone!
 

Whattteva

Wizard
Joined
Mar 5, 2013
Messages
1,824
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.
 
Last edited:

Whattteva

Wizard
Joined
Mar 5, 2013
Messages
1,824
...or just sudo -i
Ah right, that works also. I'm just used to doing su - because on my systems, I don't even have sudo installed normally. But yeah, that works also and is more concise.
 
Last edited:

Whattteva

Wizard
Joined
Mar 5, 2013
Messages
1,824
or sudo tcsh if someone has changed the default shell to something crappy; substitute your preferred shell for "tcsh" obviously.
Naah, that wouldn't work because this is Linux that we're talking about and they don't include tcsh by default and use silly shenanigans like substitute bash/zsh as the default shell along with other silliness like disabling root user, and inserting other monstrosities like systemd, etc.
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
Naah, that wouldn't work because this is Linux that we're talking about and they don't include tcsh by default and use silly shenanigans like substitute bash/zsh as the default shell along with other silliness like disabling root user, and inserting other monstrosities like systemd, etc.

Well, I did say "substitute your preferred shell". I've had to do this with OS X and certain other systems for many years. It has a certain readability and memorability to it that "-i" or "su -" lacks.
 

Whattteva

Wizard
Joined
Mar 5, 2013
Messages
1,824
Well, I did say "substitute your preferred shell". I've had to do this with OS X and certain other systems for many years. It has a certain readability and memorability to it that "-i" or "su -" lacks.
Ahhh... touché. I did miss that part. My mistake.

Yes, OS X used to stay true to its FreeBSD roots and shipped with tcsh by default, but then started following Linux and switched to bash for a bit and now to zsh in the latest version.
 
Joined
Oct 22, 2019
Messages
3,641

Whattteva

Wizard
Joined
Mar 5, 2013
Messages
1,824
Or su -c "sudo su -c 'sudo sususu su -l'"



Wait, can't you just add /usr/sbin to the "admin" user's PATH?
Yes, but it's more than just that. There are:
  1. /usr/sbin
  2. /usr/local/sbin
  3. /sbin
  4. /root/bin (this is more custom stuff though).
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
Wait, can't you just add /usr/sbin to the "admin" user's PATH?

Yes, but the default profile in /etc is a bit insipid. See my post #2 reply in the following thread


Your fix for this is to use your preferred dotfiles. You *do* have preferred dotfiles, don't you? :smile: The problem seems to be that none of the developers have actually tried to use their newfangled admin account feature for actual administrative tasks.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
The problem seems to be that none of the developers have actually tried to use their newfangled admin account feature for actual administrative tasks.
It lets you work in the GUI; what else could you possibly want? :rolleyes:
 
Top