Chinaunix首页 | 论坛 | 博客
  • 博客访问: 30103553
  • 博文数量: 230
  • 博客积分: 2868
  • 博客等级: 少校
  • 技术积分: 2223
  • 用 户 组: 普通用户
  • 注册时间: 2009-10-08 21:48
个人简介

Live & Learn

文章分类

全部博文(230)

文章存档

2022年(2)

2019年(5)

2018年(15)

2017年(42)

2016年(24)

2015年(13)

2014年(1)

2012年(5)

2011年(58)

2010年(56)

2009年(9)

我的朋友

分类: LINUX

2016-09-13 11:22:37

Dropbear是一个相对较小的SSH服务器和客户端。它运行在一个基于POSIX的各种平台。 Dropbear是开源软件,在麻省理工学院式的许可证。 Dropbear是特别有用的“嵌入”式的Linux(或其他Unix)系统,如无线路由器。(一个完整的openssh大小有7M左右)


 参阅官网:

准备

zlib-1.2.3.tar.gz 

dropbear-0.52.tar.gz 

1.交叉编译zlib-1.2.3.tar.gz

解压zlib-1.2.3.tar.gz,创建/usr/local/zlib目录;

./configure --prefix =/usr/local/zlib

修改Makefile

CC=arm-linux-gcc

AR=arm-linux-ar rc

RANLIB=arm-linux-ranlib

make;make install;

2.交叉编译dropbear-0.52.tar.gz

解压dropbear-0.52.tar.gz,创建/usr/local/dropbear;

./configure –prefix=/usr/local/dropbear –with-zlib=/usr/local/zlib/ CC=arm-linux-gcc –host=arm

make;

make scp;

make install;

cp scp /usr/local/dropbear/bin/

3.移植到6410:

将/usr/local/dropbear/bin/和/usr/local/dropbear/sbin/下的文件都复制到板上/usr/sbin目录。

在板上生成server key:

cd /etc
mkdir dropbear
cd dropbear
dropbearkey -t rsa -f dropbear_rsa_host_key
dropbearkey -t dss -f dropbear_dss_host_key

在启动脚本/etc/init.d/rcS中增加: /usr/sbin/dropbear

 

3.配置ssh:

在dev中创建pts目录:mkdir /dev/pts -p

在fstab文件中添加一段 none /dev/pts devpts defaults 0 0

#vi /etc/fstab

none    /dev/pts devpts defaults        0       0

然后 mount -a

问题应该能够得到解决


修改root密码(如果无法修改请在/etc中添加passwd与group文件)

pwsswd文件中如下

root:9.iWjoCN45yCg:0:0:Linux User,,,:/root/:/bin/sh

我这里测试goup文件空的也可以

 

或者:

root状态下在板上输入命令添加用户michael和设置密码 //最好直接改root密码

adduser michael

 注意:一定要有HOME目录,不然会登录失败

用putty连接就能连上去了~ 如果不行的话直接用root用户试试~

有时遇到的问题Host key verification failed失败如下:

[root@root linux-2.6.32-220.el6]# ssh root@192.168.100.110

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that the RSA host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
f1:61:f8:ae:19:0a:5e:e4:38:eb:0b:ad:ff:0e:86:cb.
Please contact your system administrator.
Add correct host key in /root/.ssh/known_hosts to get rid of this message.
Offending key in /root/.ssh/known_hosts:2
RSA host key for 172.16.100.110 has changed and you have requested strict checking.

Host key verification failed.

原因: /root/.ssh/known_hosts列表有兼容

解决的办法是删除 /root/.ssh/*所有文件。

重新登入即可。

#ssh root@192.168.100.110

会提示输入yes/no?然后就成功了。当然如果想用winscp的话也可以,选择scp协议。

另外当使用scp时可能有问题:

/usr/bin/dbclient: No such file or directory
这是因为我们把dbclient拷贝到/usr/sbin/目录下了。移动dbclient或者做一个软连接即可。


#mv /usr/sbin/dbclient /usr/bin/dbclient

阅读(3799) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~