0

I want to block a normal user from using a command, in sudoers file. I don't want the user to be able to use sudo at all. I tried editing sudoers file like this:

student ALL=/usr/bin/*, !/usr/bin/pwd   

This doesn't seem to work, since the user has access to pwd command.Though, he doesn't have access to pwd command using sudo ( while having access to all other commands using sudo ). What I want, is for the user to be restricted to use sudo, and to be restricted from using the pwd command. Can this be done with sudoers file?

Thanks.

  • Most shells provide pwd as a shell builtin – steeldriver Sep 28 '19 at 2:39
  • So this means I can't block a user from using it ? what about other commands like "reboot" ? – AlexP Sep 28 '19 at 2:41
  • 1
    Also the sudoers file can not block commands not run with sudo – Soren A Sep 28 '19 at 4:03
0

I choose this a final answer :

Also the sudoers file can not block commands not run with sudo – Soren A

Thanks.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.