Ask Different is a question and answer site for power users of Apple hardware and software. 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 have a Macbook Air that I would like to allow remote SSH access to without a password. I have created a user called remotepair that I have logged into and verified I can used the Mac with. I have also added this user to the "Remove Login" service's allowed user list and turned on the service. This was all done in the "Sharing" control panel.

I have gotten the public key of another computer and added it to the file /Users/remotepair/.ssh/authorized_keys. When the other computer does ssh remotepair@<my ip> I still get a password prompt.

How do I disable this password prompt?

share|improve this question
I recommend adding "SSH Key-only authentication" to your question title--the way it reads now sounds like a regular GUI loginwindow login. – NReilingh Jul 31 '12 at 3:38
up vote 18 down vote accepted

To disable password authentication you need to edit /etc/sshd_config. In Terminal:

sudo vim /etc/sshd_config

(or replace with your favourite editor)

Look for the line:

#ChallengeResponseAuthentication yes

And change it to:

ChallengeResponseAuthentication no

That is, remove the # at the beginning, and change yes to no.

All subsequent ssh logins will now REQUIRE you to use an ssh key and will not prompt for a password. Ensure your ssh key works before doing this if you have no local access! There's no need to restart the ssh daemon or anything because it is started on demand for each new incoming connection. Note that you may also see a PasswordAuthentication line, but that defaults to no already.

If your ssh keys aren't working then that's a separate issue really, but this answers the question as it is posed now :)

share|improve this answer
I also need to add the user to the AllowUser setting. I can only guess the GUI setup didn't also modify this text line. – Jason Jul 31 '12 at 17:28
Note, in later versions of Mac OS X (definitely in El Capitan), sshd_config has been moved to /etc/ssh/. – cormacrelf Feb 19 at 0:47

You should check the permissions of the directories involved: /Users/remotepair/ and /Users/remotepair/.ssh, they must not allow write access by "other" users. My .ssh has access rights only for the owner.

Also, on the remote system, do a ssh -v remotepair@yoursystem to see which authorization methods are allowed and attempted. Lookout for Authentications that can continue: publickey,password,keyboard-interactive. Maybe you must enable RSAAuthentication on your system.

share|improve this answer

Your Answer


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.