编译openssl
cd ../openssl-0.9.8e/# 红色部分同上,根据自己的需求进行修改./Configure --prefix=/home/xx/arm/ssh/install/openssl-0.9.8e os/compiler:arm-none-linux-gnueabi-gcc
make && make install
一般到了这里会出现下列问题,处理后重新 make && make install 即可:
(笔者建议使用 红色加粗的命令)
编译和安装openssl时出错,POD document had syntax errors错误信息: installing man1/smime.1 smime.pod around line 272: Expected text after =item, not a number smime.pod around line 276: Expected text after =item, not a number smime.pod around line 280: Expected text after =item, not a number smime.pod around line 285: Expected text after =item, not a number smime.pod around line 289: Expected text after =item, not a number POD document had syntax errors at /usr/bin/pod2man line 71. make: *** [install_docs] 错误 255 原因分析:这是由于OpenSSL 1.0.1e 与 perl5.18 不兼容。 解决方法: 1. 安装perl 5.16 可以兼容,安排低版本perl 5.16可以解决问题。 2. 让 pod2man 无法被访问: sudo rm /usr/bin/pod2man 或 sudo mv /usr/bin/pod2man /usr/bin/pod2man_bak
编译openssh
红色部分依旧根据实际情况进行修改
cd ../openssh-4.6p1/./configure --host=arm-none-linux-gnueabi \
--with-libs --with-zlib=/home/xx/arm/ssh/install/zlib-1.2.11 \
--with-ssl-dir=/home/xx/arm/ssh/install/openssl-0.9.8e \
--disable-etc-default-login \
CC=arm-none-linux-gnueabi-gcc AR=arm-none-linux-gnueabi-ar
make
#注意:openssh不需要make install
如果出现以下某个报错,请注意zlib的install路径 和 OpenSSL的install路径 是否正确
configure配置openssh的时候出错:configure: error: *** zlib missing - please install first or check config.log ***
configure: error: *** Can‘t find recent OpenSSL libcrypto (see config.log for details)
开发板准备:
新建以下目录
mkdir -p /usr/local/bin/mkdir -p /usr/local/sbin/mkdir -p /usr/local/etc/mkdir -p /usr/local/libexec/mkdir -p /var/run/mkdir -p /var/empty/
拷贝:
从PC机上将以下文件拷贝到目标板Linux系统中
PC机 ssh/source/openssh-4.6p1/ 目录下的
- scp sftp ssh ssh-add ssh-agent ssh-keygen ssh-keyscan 拷贝到目标板/usr/local/bin
- moduli ssh_config sshd_config拷贝到目标板 /usr/local/etc
- sftp-server ssh-keysign 拷贝到目标板 /usr/local/libexec
- sshd 拷贝到目标板 /usr/local/sbin/
生成Key文件
在PC机 ssh/source/openssh-4.6p1/ 目录下运行:
ssh-keygen -t rsa -f ssh_host_key -N ""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_host_*_key这4个文件copy到目标板的 /usr/local/etc/目录下
修改目标板passwd文件
如果连接不上,请直接运行 /usr/local/sbin/sshd 查看是什么原因
- 有提示 动态链接库 找不到的(工具链的动态链接库)
- 有提示 ssh_host 文件找不到的 生成即可
ref :
Arm-Linux 移植 ssh
标签:平台 动态链接 bcrypt sftp exe exec bsp login agent
原文地址:https://www.cnblogs.com/schips/p/11173968.html