Quote:
Originally Posted by pan64
you can find a lot of information about it on the net. The only thing you need to take into account that you need to copy the key file manually onto your board (or you may try to copy it directly to the sd card).
|
Dear pan64,
I tried to manually copy the public key to my development board but still not able to access it without password.
Actually the link which I followed for the cross compilation of the openSSH for my system is this :
http://www.veryarm.com/892.html
I was able to successfully cross compile and than port it to my development board. But I have been stuck at the step in which the board asks for the password for getting logged in through SSH.
I have problem in few things and not able to resole it because of my fresh experience with the openSSH and also not any material present on the internet related to this problem.
first of all I followed this step:
$ cd /usr/local/etc/
$ ssh-keygen -t rsa -f ssh_host_rsa_key -N ""
$ ssh-keygen -t dsa -f ssh_host_dsa_key -N ""
$ ssh-keygen -t ecdsa -f ssh_host_ecdsa_key -N ""
$ ssh-keygen -t dsa -f ssh_host_ed25519_key -N ""
to generate the keys.
Now for the passwordless login I have to add the public key to the authorized keys which I store in the /.ssh folder.
Now since my all keys are present in the /usr/local/etc and authorized_keys file is present in the /.ssh folder, therefore I think the ssh is not able to check for the key and still asking for the password.
So What I did is I removed all the keys from the folder /usr/local/etc and than try to run the sshd binary but it stopped saying this:
~ $ /usr/local/bin/sshd
Could not load host key: /usr/local/etc/ssh_host_rsa_key
Could not load host key: /usr/local/etc/ssh_host_dsa_key
Could not load host key: /usr/local/etc/ssh_host_ecdsa_key
Could not load host key: /usr/local/etc/ssh_host_ed25519_key
Disabling protocol version 2. Could not load host key
sshd: no hostkeys available -- exiting.
Meanwhile I created a fresh key by executing the command:
$ ssh-keygen -t rsa
and it gets created in the .ssh folder in the root directory alongwith the authorized_keys.
~ $ ls -l /.ssh/
-rw------- 1 root root 415 Mar 5 00:44 authorized_keys
-rw------- 1 root root 1675 Mar 5 00:41 id_rsa
-rw-r--r-- 1 root root 395 Mar 5 00:41 id_rsa.pub
after this command I started the sshd with the command:
$ ssh-keygen -t rsa
but still it shows the error
~ $ /usr/local/bin/sshd
Could not load host key: /usr/local/etc/ssh_host_rsa_key
Could not load host key: /usr/local/etc/ssh_host_dsa_key
Could not load host key: /usr/local/etc/ssh_host_ecdsa_key
Could not load host key: /usr/local/etc/ssh_host_ed25519_key
Disabling protocol version 2. Could not load host key
sshd: no hostkeys available -- exiting.
So my sshd is not able to lookafter for the key in the folder /.ssh here I think and therefore not able to look into the authorized_keys file.
I also copied the authorized_keys file to the /usr/local/etc folder but that also didn't worked.
So what should I do to make ssh to read the authorized_keys file in the /.ssh folder.
Please help me in this regard so that I can accomplish this task.