I have a corporate account work
on my macbook that has administrator privileges and created a non-administrative account local
.
Logged in as local
, when I tried a command with sudo, I got the familiar is not in the sudoers file
.
The file /etc/sudoers
is owned by the usual root/wheel
. I tried to modify the file inside a su work
shell but it was readonly for that user. Then I tried su root
but that didn't work either. Then I found out that I need to enable to the root user.
I enabled the root user, but still cannot su root
, still get the same terse su: Sorry
. I seem to have enabled the root user correctly, since the process to enable it now gives the option to disable it or change password.
How can I get su
to work for user local
? Is there a another way to allow the user local
to use sudo
?
Best Answer
I found out that the I was able to modify
/etc/sudoers
when I logged in aswork
usingssh
. Not sure if I had made some mistake with my previous attempt withsu - work
.The following steps worked:
local
, start withssh work@localhost
sudo visudo
local ALL=(ALL) ALL
sudo ls /