I have a remote linux system that I can connect to via ssh and public key and then execute the following command:
sudo jetty restart
This command on this system is configured to allow anyone to execute without the sudo password. I.e. the sudoers file probably looks something like this
%develop ALL = NOPASSWD: /opt/scripts/jetty
This is great as we can execute this script with elevated privileges while keeping everything else locked down. The problem is when trying to execute this command remotely, I am always asked for the sudo password.
me@home:~$ ssh -t -i ~/.ssh/identity me@remote.server.com 'sudo jetty restart'
Password: .....? (I don't have the sudo password!)
Is there a way I can execute this command remotely?
requirettyis off? There is also atty_ticketsparameter you wish to examine. – MattBianco Sep 10 '10 at 10:05ssh -ta tty is always allocated. Besides, withrequiretty,sudowould fail before asking for a password. – grawity Sep 13 '10 at 13:12