sudo works as root, not as user

Status
Not open for further replies.

mweinmann

Dabbler
Joined
Jun 25, 2014
Messages
17
Why is this?


This is ssh'd into freenas base, not a jail.

Sudo as root works, i get sudo 'help' output as expected.
sudo as a user gives me:

sudo: error in /etc/sudo.conf, line 0 while loading plugin `sudoers_policy'
sudo: unable to load /usr/local/libexec/sudo/sudoers.so: (null)
sudo: fatal error, unable to load plugins​

I tried making the sudo libraries all read only, fully, no change. I'm not really sure what is going on.. There was no /etc/sudo.conf file. I did a touch sudo.conf to add and tried, no luck. sudo.conf exists at /usr/local/etc/sudo.conf.
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,977
What exactly are you trying to accomplish?
 
Joined
Jan 9, 2015
Messages
430
Root is already the super user. So, root doesn't have to sudo. Look at the user in the Web GUI that you are trying to sudo with and see if that user is a sudoer.
 

mweinmann

Dabbler
Joined
Jun 25, 2014
Messages
17
The user is checked to allow sudo. I just want to be able to sudo from a non root account. I don't get it.


Sent from my iPhone using Tapatalk
 

mweinmann

Dabbler
Joined
Jun 25, 2014
Messages
17
This is a wider problem. other programs, run as user mode, throwing missing shared objects - is there some way to rebuild library links
 

INCSlayer

Contributor
Joined
Apr 4, 2015
Messages
197
what programs are you running and why are you running them from the base system and not from inside a jail?
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
You have been mucking with the base system. You shouldn't do this because you will break everything and it's not meant to be modified. You should backup your configuration and do a factory reset. This will fix all the files you changed.
 

pirateghost

Unintelligible Geek
Joined
Feb 29, 2012
Messages
4,219
Freenas is an appliance.

Do not modify the base system, it is as simple as that.

I can see absolutely no reason to have a regular user able to run sudo on the base system. Use the jails, that is why they exist.
 

mweinmann

Dabbler
Joined
Jun 25, 2014
Messages
17
I didn't change anything until the problems began. I thought basic Unix preference was to login as user and sudo root commands regardless of Unix. Why is there a sudo option in the gui if that is not even recommended and you scold those that use it?


Sent from my iPhone using Tapatalk
 

pirateghost

Unintelligible Geek
Joined
Feb 29, 2012
Messages
4,219
I didn't change anything until the problems began. I thought basic Unix preference was to login as user and sudo root commands regardless of Unix. Why is there a sudo option in the gui if that is not even recommended and you scold those that use it?


Sent from my iPhone using Tapatalk
What do you need to do in the cli as sudo?
 

mweinmann

Dabbler
Joined
Jun 25, 2014
Messages
17
Usually just jls and jexec. I was going through an exercise to change my behavior to login to base and jails as user and sudo from there. When I was testing it on base ran into errors. I will try the reset. It's been installed and upgraded for some time.


Sent from my iPhone using Tapatalk
 

mweinmann

Dabbler
Joined
Jun 25, 2014
Messages
17
But that being said should it throw shared object errors?


Sent from my iPhone using Tapatalk
 

pirateghost

Unintelligible Geek
Joined
Feb 29, 2012
Messages
4,219
No. It just sounds like you have an install that is in an inconsistent state.
 

mweinmann

Dabbler
Joined
Jun 25, 2014
Messages
17
I would agree. Will see what a reset does.

Thanks all!


Sent from my iPhone using Tapatalk
 

Robert Trevellyan

Pony Wrangler
Joined
May 16, 2014
Messages
3,778
I thought basic Unix preference was to login as user and sudo root commands regardless of Unix.
This is one of the most obvious (to me) differences between Linux and Unix. Linux seems to be much more wary of direct use of the root account than Unix.

The thing is, once you're logged into the FreeNAS GUI, you have root-level access to everything anyway, so there's no point in using sudo in the GUI shell. It's different if you want to give various users SSH access.
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,977
Log in via ssh as your user and then type su and enter the root password to switch to root. Then you will be able to switch to the jails (jexec) and do what you need to do as root without using sudo. No need to make it any harder than necessary.
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,977
I didn't change anything until the problems began. I thought basic Unix preference was to login as user and sudo root commands regardless of Unix. Why is there a sudo option in the gui if that is not even recommended and you scold those that use it?


Sent from my iPhone using Tapatalk
What are you running for hardware?
 

mweinmann

Dabbler
Joined
Jun 25, 2014
Messages
17
I always login ssh. As user typing su gives error. I know how to use just didn't get why an error as user but not root. Plan to do reset soon to resolve


Sent from my iPhone using Tapatalk
 

mweinmann

Dabbler
Joined
Jun 25, 2014
Messages
17
This morning I installed a fresh version of freenas onto a new usb flash drive. I imported my backup and it's restored perfectly. The user-mode sudo error is gone.

I'm quite impressed how perfectly and easily the config was restored, imported volumes, etc.

Great job!
 
Status
Not open for further replies.
Top