trusted hosts file

Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Atheros WiSOC based Hardware
Author Message
ggp81
DD-WRT Novice


Joined: 07 Feb 2007
Posts: 45

PostPosted: Fri Oct 08, 2010 13:28    Post subject: trusted hosts file Reply with quote
Hello,

I'm configuring my WZR-HP-G300NH to do some operations at startup. So I wrote some scripts in the web GUI (DD-WRT v24SP2-EU-US), and they perfectly work.

Now I'm trying to perform some operations with SCP. So I have found this link:
http://www.dd-wrt.com/wiki/index.php/Telnet/SSH_and_the_Command_Line
and then added to my script a row in this way,
DROPBEAR_PASSWORD='my password' ssh user@hostname
as explained in the tutorial. It works too, but only if user@hostname is in the known_hosts file.
Is there a clean way to add it from the web GUI?

I have tried to put the following string in "Service > Secure shell > Authorized key", from the web GUI:

ssh-rsa AAAAB3NzaC1yc2E ... 4Frw9K7CfCigdAQ== ggp@10.0.0.10

and then in the shell tried to connect via ssh, but the result is the following:
root@DD-WRT:~# ssh ggp@10.0.0.10

Host '10.0.0.10' is not in the trusted hosts file.
(fingerprint md5 de:39:5d:17:aa:0a:8c:47:36:28:6e:e1:25:fe:74:01)
Do you want to continue connecting? (y/n)

Have I missed something?

Thank you very much.
Sponsor
iWill
DD-WRT Novice


Joined: 15 Feb 2011
Posts: 13

PostPosted: Tue Feb 15, 2011 20:16    Post subject: Re: trusted hosts file Reply with quote
Solution:
1. Now file known_hosts not exists.
ssh from router to 10.0.0.10 answer yes to "Host '10.0.0.10' is not in the trusted hosts file. Do you want to continue connecting? (y/n) "
2. cat /tmp/root/.ssh/known_hosts and save output somewhere. It will be something like 10.0.0.10 ssh-rsa xxx...
3. Before you write DROPBEAR_PASSWORD='my password' ssh user@hostname put in your script lines like this:
Code:
echo 10.0.0.10 ssh-rsa xxx... > /tmp/root/.ssh/known_hosts
HOME=/tmp/root


The first line will write 10.0.0.10's key to trusted keys list so you will not be prompted anymore to push 'y'
The second line will help dropbear to find known_hosts file because by default HOME=/ and ./ssh could not be created because of read only
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Atheros WiSOC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum