Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

3 Answers 3

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? –  Shalom 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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.