ssh - osx - Set application access to certificate via command line

19
2014-04
  • JFoulkes

    I want to allow permanent access to certificates for certain app (eg codesign) via command line. The gui equivalent would be clicking "Always Allow" when prompted. However I only have access via SSH

    I want to do what is asked in this question: OSX - Disable keychain password prompts only via terminal.

  • Answers
    Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

    Related Question

    Execute a sudo NOPASSWD command remotely via SSH
  • Alex Spurling

    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 [email protected] 'sudo jetty restart'
    Password: .....? (I don't have the sudo password!)
    

    Is there a way I can execute this command remotely?


  • Related Answers
  • grawity

    Make sure sudo is picking the right command; if there's a /usr/bin/jetty or such, the sudoers rule won't match. (Note that your ~/.bashrc and such files are ignored when using ssh <host> <command>, so your $PATH customizations never happen.)

    sudo /opt/scripts/jetty restart should work.