Tag Info

New answers tagged


Though correct, I think the above answer is a little incomplete. In order to do both touch and ls as peeradmin user, the rule in /etc/sudoers file should look like: nagios ALL=(peeradmin) NOPASSWD: /bin/ls, /bin/touch If you would like to run more commands, then add those commands (with full path) separated with a comma. Once you do that, just use the ...


That's because it's sudo config, and you don't run sudo. sudo su - peeradmin -c "ls" might work. But really, should should be thinking more in terms of using sudo directly if it's just running commands. e.g. sudo -u peeradmin ls For which you'd need an alias: nagios ALL=(peeradmin) NOPASSWD: /bin/ls


su requires the destination user password, in this case the root user's password. sudo requires the current user password and a line in /etc/sudoers on linux or /usr/local/etc/sudoers on freebsd. Linux and freebsd su do not typically observe group-based authorization. Try sudo -i as a wheel or sudo group member. If this does not work, you will have to ...

Top 50 recent answers are included