//
stai leggendo...
domanda

Sudo under AppleScript

sysadmin by chance

Hey guys,
I am having a hell of a time trying to Sudo with an AppleScript. 
Heres the code…

do shell script “sudo ifconfig en0 down; sudo ifconfig en0 up”

When executed, it says AppleScript Error password: password: . Any ideas how this can be done to automate the password? I have tried everything I know, and to no avail. Oh, thanks for your help in advance

METHOD #1, not so secure if many people are going to read the AppleScript source, but tons easier to do:Read what cello wrote below.

METHOD #2, a little bit more secure:

If you’re not worried about ANYONE doing sudo ipconfig’s without a password (it has to be your username anyway so not much of a concern there) on your system, you can have sudo automatically run it without a password. Here’s how!

Code:
$ sudo visudo
password:

You’ll be presented with the…

View original post 183 altre parole

Annunci

Discussione

Non c'è ancora nessun commento.

Rispondi

Inserisci i tuoi dati qui sotto o clicca su un'icona per effettuare l'accesso:

Logo WordPress.com

Stai commentando usando il tuo account WordPress.com. Chiudi sessione / Modifica )

Foto Twitter

Stai commentando usando il tuo account Twitter. Chiudi sessione / Modifica )

Foto di Facebook

Stai commentando usando il tuo account Facebook. Chiudi sessione / Modifica )

Google+ photo

Stai commentando usando il tuo account Google+. Chiudi sessione / Modifica )

Connessione a %s...

%d blogger hanno fatto clic su Mi Piace per questo: