Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to find a way of turning on SSH through terminal, instead of opening settings and turn it on that way. Or perhaps a way to turn SSH on by running a .pkg file?

I am running OS X Lion, but it would be great if it also worked on Snow Leopard!

share|improve this question

enable remote login

systemsetup -setremotelogin on

disable remote login

systemsetup -setremotelogin off
share|improve this answer
    
Can i allow it for a specific user via terminal? – user389393 Nov 13 '14 at 9:04

You may have to sudo:

    sudo systemsetup -setremotelogin on
share|improve this answer

I've found terminal WILL ask:

Do you really want to turn remote login off? If you do, you will lose this connection and can only turn it back on locally at the server (yes/no)?

Typing 'yes' in scripts is not always possible. To resolve this, use a -f flag before -setremotelogin, like so:

systemsetup -f -setremotelogin on
systemsetup -f -setremotelogin off
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .