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?
Best Answer
To disable password authentication you need to edit
/etc/ssh/sshd_config
. InTerminal
:(or replace with your favourite editor)
Look for the line:
And change it to:
That is, remove the
#
at the beginning, and changeyes
tono
.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 tono
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 :)