Actually, my root have to aliases:

alias unpool='/path/to/my/scripts/unpool.sh'
alias pool='/path/to/my/scripts/pool.sh'

I have the same for my user in ~/.bashrc

I defined my /etc/sudoers.d/user with

user ALL=(root) NOPASSWD: /bin/cp
user ALL=(root) NOPASSWD: /path/to/my/scripts/pool.sh
user ALL=(root) NOPASSWD: /path/to/my/scripts/unpool.sh

But logged with my user, I can't do sudo unpool, it ask me my password

What can I do ?

  • 2
    Your shell would need to first expand that alias and pass the fully qualified command path to sudo. Simpler might be alias unpool='sudo /path/to...' – thrig Aug 26 '15 at 16:24
  • I believe it should say ALL=(ALL) not ALL=(root). – alexus Aug 26 '15 at 16:31

Your Answer

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

Browse other questions tagged or ask your own question.