Dormir y reiniciar un Mac remota y localmente

Es posible reinciar, apagar y dormir nuestro mac remotamente desde la línea de comandos:

$ ssh user@hostname "sudo osascript -e 'tell application \\"Finder\\" to sleep'"

Y apagar:

$ ssh user@hostname "sudo osascript -e 'tell application \\"Finder\\" to shut down'"

Para ello debemos activar el servidor SSH (acceso remoto), desde el panel de control de _Compartir_, o bien desde el terminal:

$ sudo systemsetup -setremotelogin on

ó

$ serversetup -enableSSH

Para ver si está activo:

$ sudo systemsetup -getremotelogin
Password:
Remote Login: On

This entry was posted on Jueves, Abril 7th, 2005 at 13:38 and is filed under AppleScript, Terminal, Uncategorized. You can follow any responses to this entry through the RSS 2.0 feed. You can skip to the end and leave a response. Pinging is currently not allowed.

2 Responses to “Dormir y reiniciar un Mac remota y localmente”

  1. ktulu Says:

    Ei hola, me parece que no acaba de funcionar pues me da un error, supongo del AppleScript
    17:18: syntax error: Expected expression, property or key form, etc. but found unknown token. (-2741)
    Utilizo Mac OS X Client con ssh activo y me seria de mucha utilidad poderlo reiniciar a través de SSH.
    Con el clásico reboot no me funciona, pues después no reinicia correctamente.
    Gracias por tu ayuda.

  2. Brocoli Fresco Says:

    ¿¿qué escribiste exactamente??

    Prueba a quitar las dobles comillas antes y después de Finder.

Leave a Reply