Skip to content

Improvements on the passwordless ssh tutorial #771

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed

Improvements on the passwordless ssh tutorial #771

wants to merge 2 commits into from

Conversation

tecaspt
Copy link

@tecaspt tecaspt commented Nov 22, 2017

I've never been able to setup passwordless ssh with the provided instructions on several Raspbian installs. It's always missing the step I added. Today, upon setting up a new machine, I remembered this tutorial and decided to try and correct it.

@texadactyl
Copy link

I take an approach that only uses ssh commands.

Goal: userA@MachineA ==ssh==> userB@MachineB

If you wish to login to the root on MachineB,
then make sure that MachineB /etc/ssh/sshd_config has the following:

 PermitRootLogin yes

and then restart the sshd daemon on MachineB (or reboot it).

While logged into userA@MachineA, do the following:

 cd $HOME
 ssh-keygen # Be sure to use a nil password!
 ssh-add
 ssh-copy-id userB@MachineB

Test:

 ssh userB@MachineB

Note that If the ssh-add step above fails, ssh-agent is probably not running:

 eval `ssh-agent -s`
 ssh-add # Try again

@tecaspt
Copy link
Author

tecaspt commented Nov 22, 2017

That's a possibility too. But that's up to folks on the Raspberry Pi website to see if they want a complete overhaul of the tutorial... :)

@bennuttall
Copy link
Contributor

Thanks for the contribution.

This step is not necessary - I do this all the time - if you have an SSH key, you can get in without a password, but if you don't, it asks for a password. If you set PasswordAuthentication no then you can only get in with an SSH key (no password prompt is available), but it's not a requirement for passwordless SSH.

Personally, I use ssh-copy-id to get the key on the Pi, but we decided not to include it here because it's not available on Mac. I would like to add it anyway (just saying it's available on Linux).

@tecaspt if you still have a problem, can you please post a screenshot or something to show what happens?

@DG12
Copy link
Contributor

DG12 commented Feb 2, 2018

Mac OS HighSierra has it.

ls -l /Volumes/HighSierra/usr/bin/ssh-copy-id
-rwxr-xr-x 1 root wheel 10658 Oct 24 21:19 /Volumes/HighSierra/usr/bin/ssh-copy-id*

@JamesH65
Copy link
Contributor

@bennuttall Since this does appeat to be present on Mac, can we do an update to include the copy option?

@bennuttall
Copy link
Contributor

Sure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants