SSH key authentication
|
18th Jun, 2015, 06:51 AM
Post: #1
|
|||
|
|||
SSH key authentication
Hello,
I have been following the guide here .... http://raspi.tv/2012/how-to-set-up-keys-and-disable-password-login-for-ssh-on-your-raspberry-pi ... to add keys to fresh image of xbain pi. It used to work before, but now I have a problem in that whatever I do I get the 'server refused our key' message. I made sure to remove the unwanted items so the key begins with just ssh-rsa AAA etc. and made sure to remove any breaks or returns so it is all on one line. Has the move to inet.d made a difference in the procedure? I'll keep on searching, but no good ideas so far. Skywatch. |
|||
18th Jun, 2015, 07:14 AM
Post: #2
|
|||
|
|||
RE: SSH key authentication
In a normal setup it's pretty easy.
XBian 1 Code: ~# ssh-keygen -f /root/.ssh/id_xbian -N "" XBian 2 Code: ~# echo "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCyv3fYKrokrVm8PTqtwLuJjUarvJlCbnbR8HAwUlaVLo3vz+I6WnB+vXemJ6gcCL8Re0Y1RDN1ThikPJ+rBG7lc8cca5bMbcQ98J6EVPljd/aoabkMntKcTYBwfEXNQljOpxb94Kp4/9OEPo8Sg68p+m2evfZmaa6UhA/DzIKWSI3ZBbQpH+XV+sZd1c7fsdp4/OLCKrXwrWd9xlcKvx60hI6Eg8f9Z/vd3sINsrgN83Lq/PynTWVcciUSSbBOB8nYLCMR2apMLDpiqBmLxNO5mI0VEdht/sfEjZxDZi/ldTaMnVNLqs0Qk58XJlDcRzL2oHtCVX9UHsKVxNz9KFwp" > /root/.ssh/authorized_keys XBian 1 (192.168.1.1) Code: ~# ssh 192.168.1.1 -i /root/.ssh/id_xbian That should be it. Do notice that these steps are made for direct root login over ssh. If you want to use the xbian user, change the XBian 2 key path to /home/xbian/.ssh/authorized_keys. If you login with XBian 1 with ssh xbian@192.168.1.1 -i /root/.ssh/id_xbian pilight - modular domotica solution
|
|||
18th Jun, 2015, 06:16 PM
Post: #3
|
|||
|
|||
RE: SSH key authentication
CurlyMo,
Thanks for taking the time to explain that. I generated the keys using puttygen on a laptop and then copied and pasted them into xbian under the path /home/xbian/.ssh/authorized_keys , then did the chmod and edited the keys as stated, so that should have worked. So far the 2 pi's look like the installations are identical. Only difference is that pi1 is using an RC release with xbmc and pi2 is using xbian1.0. Both pi's are to be accessed by a Win7 laptop using putty (again as far as I can tell the presets in putty have the correct paths for the keys). I'll spend some more time today Just one question though, as /etc/services is now where the SSH port is changed is sshd_conf still used for keys and settings etc? Thanks Skywatch |
|||
18th Jun, 2015, 06:31 PM
Post: #4
|
|||
|
|||
RE: SSH key authentication
I didn't have to change the SSH configuration. And please use the ssh-keygen. Then i know for sure you did the same thing.
pilight - modular domotica solution
|
|||
18th Jun, 2015, 07:42 PM
Post: #5
|
|||
|
|||
RE: SSH key authentication
HI CurlyMo,
I finally got the problem. Seems that authorized_keys was owned by root. Chaning that ownership to 'xbian' and it works now! I don't recall having to do this previously, but hey, if it works, it works! Thanks for kind assistance with this. Skywatch. |
|||
« Next Oldest | Next Newest »
|