sudoers

Fastest Way to Determine User Permissions in /etc/sudoer

Users will be remotely accessing ***nix based machines via SSH and I need to determine the fastest way to check if the username that they are currently using has NOPASSWD access in the /etc/sudoers file. Possible options: grep for the username in /etc/sudoers, parse command prompt output to determine if it has NOPASSWD, if not, remove...

Calling ejabberdctl from PHP

I am working on a php social network that requires us to create XMPP accounts for all new members. I have a working Ejabberd server running with mod_admin_extra all working fine. I am trying to call ejabberdctl from a php file like so: exec('sudo /home/user/ejabberd-2.1.2/bin/ejabberdctl register test server pass 2>&1'); but i get t...

Using Net SSH to execute commands with sudo

I've been trying to write a small library using Thor to help assist me in quick creating new projects and sites. I wrote this small method: def ssh(cmd) Net::SSH.start( server_ip, user, :port => port) do |session| session.exec cmd end end to just assist me in running quick commands on remote servers when needed. The proble...