arm开发板-linux系统-ssh移植记录
2017-12-25 13:42
309 查看
arm开发板想要使用ssh功能传输文件,需要自己移植该功能。
可以使用提供的工具,直接移植到板子上。具体的编译过程,在最后介绍。
网盘链接:
链接:https://pan.baidu.com/s/1gfaVyQf 密码:0nw6
2、把工具下载下来,搞到U盘上。使用挂载命令挂载。
进入U盘挂载的盘符。进入工具文件夹。
3、修改文件、修改权限
注意这里要使用600权限。其他权限会报错。
使用vim编译器打开passwd文件,并在最后添加如下两行代码:
保存退出。
4、修改root密码
连续两次输入密码。效果如下。
5、查看开发板ip和主机是不是在同一网段。
如不一样,修改后保存退出。重启。相同的话直接验证。
6、验证
使用网线连接开发板和路由器或者主机。并保证开发板和主机可以相互ping通。
使用上面命令的话,会有如下打印:
再次修改一下权限,然后继续使用刚才的命令。
此时效果如下:
虽然有一个报错。但此时使用ssh连接开发板,可以连接。并正常使用。
移植完成。
(这个报错不清楚怎么解决了。如果有知道的大神,还望不吝赐教。1260347644@qq.com)
ubuntu版本:12.04
编译器:arm-2009q3
源码上传及解压过程不叙述。
把三个源码上传到/home/ssh目录下。
1、编译zlib
2、编译openssl
3、编译openssh
注意。运行命令时,注意参数空格。另,openssh不需要make install。
在当前目录下,
使用以上五条命令。会生成五个文件。
4、拷贝文件
之所以新建以上几个文件夹是为了好对应。
生成的usr.tar.gz就是刚才使用的工具包
全部完成。
参考链接:
https://wenku.baidu.com/view/1d0cfd2a84254b35eefd34f8.html
可以使用提供的工具,直接移植到板子上。具体的编译过程,在最后介绍。
网盘链接:
链接:https://pan.baidu.com/s/1gfaVyQf 密码:0nw6
一、移植
1、系统起来后。新建以下目录。mkdir /usr/local/ mkdir /usr/lcoal/etc/ mkdir /usr/local/bin/ mkdir /usr/libexec
2、把工具下载下来,搞到U盘上。使用挂载命令挂载。
mount /dev/sda1 /mnt/disk
进入U盘挂载的盘符。进入工具文件夹。
cd local/etc/ cp -r * /usr/local/etc/ cd ../bin/ cp -r * /usr/local/bin/ cd ../../libexec/ cp -r * /usr/libexec/
3、修改文件、修改权限
cd /usr/local/etc/ chmod 600 *
注意这里要使用600权限。其他权限会报错。
cd /etc/ vi passwd
使用vim编译器打开passwd文件,并在最后添加如下两行代码:
sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin
保存退出。
4、修改root密码
passwd root
连续两次输入密码。效果如下。
passwd root Changing password for root New password: Bad password: too weak Retype password: Password for root changed by root
5、查看开发板ip和主机是不是在同一网段。
vi /etc/eth0-setting
如不一样,修改后保存退出。重启。相同的话直接验证。
reboot
6、验证
使用网线连接开发板和路由器或者主机。并保证开发板和主机可以相互ping通。
/usr/local/bin/sshd
使用上面命令的话,会有如下打印:
/usr/local/bin/sshd @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: UNPROTECTED PRIVATE KEY FILE! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ Permissions 0755 for '/usr/local/etc/ssh_host_key' are too open. It is recommended that your private key files are NOT accessible by others. This private key will be ignored. bad permissions: ignore key: /usr/local/etc/ssh_host_key Could not load host key: /usr/local/etc/ssh_host_key @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: UNPROTECTED PRIVATE KEY FILE! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ Permissions 0755 for '/usr/local/etc/ssh_host_rsa_key' are too open. It is recommended that your private key files are NOT accessible by others. This private key will be ignored. bad permissions: ignore key: /usr/local/etc/ssh_host_rsa_key Could not load host key: /usr/local/etc/ssh_host_rsa_key @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: UNPROTECTED PRIVATE KEY FILE! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ Permissions 0755 for '/usr/local/etc/ssh_host_dsa_key' are too open. It is recommended that your private key files are NOT accessible by others. This private key will be ignored. bad permissions: ignore key: /usr/local/etc/ssh_host_dsa_key Could not load host key: /usr/local/etc/ssh_host_dsa_key Disabling protocol version 1. Could not load host key Disabling protocol version 2. Could not load host key sshd: no hostkeys available -- exiting.
再次修改一下权限,然后继续使用刚才的命令。
chmod 600 /usr/local/etc/* /usr/local/bin/sshd
此时效果如下:
/usr/local/bin/sshd Disabling protocol version 1. Could not load host key
虽然有一个报错。但此时使用ssh连接开发板,可以连接。并正常使用。
移植完成。
(这个报错不清楚怎么解决了。如果有知道的大神,还望不吝赐教。1260347644@qq.com)
二、编译
刚才使用的文件都是根据源码编译出来的。下面介绍一下编译过程。ubuntu版本:12.04
编译器:arm-2009q3
cd /home/ mkdir ssh
源码上传及解压过程不叙述。
把三个源码上传到/home/ssh目录下。
1、编译zlib
cd zlib-1.2.3/ ./configure --prefix=/home/ssh/install/zlib vi Makefile ~ CC=arm-none-linux-gnueabi-gcc ~ LDSHARED=arm-none-linux-gnueabi-gcc ~ CPP=arm-none-linux-gnueabi-gcc -E ~ AR=arm-none-linux-gnueabi-ar rc make make install
2、编译openssl
cd openssl-0.9.8h/ ./Configure --prefix=/home/ssh/install/openssl os/compiler:arm-none-linux-gnueabi-gcc make make install
3、编译openssh
cd openssh-4.6p1/ ./configure --host=arm-none-linux-gnueabi --with-libs --with-zlib=/home/ssh/install/zlib --with-ssl-dir=/home/ssh/install/openssl --disable-etc-default-login CC=arm-none-linux-gnueabi-gcc AR=arm-none-linux-gnueabi-ar make
注意。运行命令时,注意参数空格。另,openssh不需要make install。
在当前目录下,
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 "" ssh-keygen -t dsa -f ssh_host_key -N ""
使用以上五条命令。会生成五个文件。
4、拷贝文件
mkdir /home/ssh/usr/ mkdir /home/ssh/usr/local/ mkdir /home/ssh/usr/local/etc/ mkdir /home/ssh/usr/local/bin/ mkdir /home/ssh/usr/libexec/
之所以新建以上几个文件夹是为了好对应。
cd /home/ssh/openssh-4.6p1/ cp ssh_host*_key /home/ssh/usr/local/etc/ cp scp sftp ssh sshd ssh-add ssh-agent ssh-keygen ssh-keyscan /home/ssh/usr/local/bin/ cp moduli ssh_config sshd_config /home/ssh/usr/local/etc/ cp sftp-server ssh-keysign /home/ssh/usr/libexec/ cd ../ tar -vcf usr.tar.gz usr/
生成的usr.tar.gz就是刚才使用的工具包
全部完成。
参考链接:
https://wenku.baidu.com/view/1d0cfd2a84254b35eefd34f8.html
相关文章推荐
- 成功移植SSH到ARM目标板的Linux系统中
- MiniCRT 64位 linux 系统移植记录:64位gcc的几点注意
- #嵌入式Linux最小系统移植# mini2440内核4.0.8移植记录
- MiniCRT 64位 linux 系统移植记录:64位gcc的几点注意
- 嵌入式linux系统中添加FTP和SSH服务过程记录
- S3C2440 Linux 系统 --- 移植步骤记录
- 嵌入式linux系统中移植SSH
- 移植linux3.7.4系统到itop4412开发板记录
- linux-3.12.6 移植yaffs2文件系统记录
- #嵌入式Linux最小系统移植# busybox分析和移植记录
- linux系统中的逻辑卷知识记录
- mini2440 移植linux2.6.30.10 及yaffs2文件系统 2011-03-12 10:17:18
- Linux系统下安装lampp集成环境记录
- android系统移植emmc记录(总)
- linux 2.6内核+根文件系统的移植实验
- 本地SecureCRT软件SSH连接腾讯云服务器(linux系统)
- Linux系统移植——Linux下USB存储设备操作
- 如何安装'atop'来监视Linux系统进程的日志记录活动
- Linux-视频监控系统(12)-移植到树莓派中