&linux开发板#xff08;1)zlib 下载网址:http://www.zlib.net/fossils/ 教程中版本选择的是: zlib-1.2.11.tar.gz
(2)openssl下载网址:https://www.openssl.org/source/mirror.html 教程中版本选择的是: openssl-1.1.1-stable-SNAP-20210701.tar.gz
(3)openssh(前两者可以看做ssh的依赖)下载网址:https://fastly.cdn.openbsd.org/ 教程中版本选择的是: openssh-8.6p1.tar.gz
0) 将上述压缩包均拷贝到Linux虚拟机下
1) 编译zlib源码
cd /home/tao/tools/openssh/zlib*
mkdir install_dir #创建安装目录
https://blog.csdn.net/tao_sc/article/details/configure --prefix=/home/tao/tools/openssh/zlib*/install #执行之后会生成Makefile
vim Makefile #修改Makfile 将其中gcc、g++都修改为交叉编译器的名称。
make
make install
2) 编译openssl源码
cd /home/tao/tools/openssh/openssl*
mkdir install_dir
https://blog.csdn.net/tao_sc/article/details/Configure linux-generic32 no-asm shared no-async --prefix=/home/tao/tools/openssh/openssl-3.1.5/install
arm-linux-gnueabihf-cpp
vim Makefile
make
make install
完成后install_dir文件夹内容:

3) 编译openssh源码
cd /home/tao/tools/openssh/openssh*
https://blog.csdn.net/tao_sc/article/details/configure --host=arm-linux --with-libs --with-zlib=/home/tao/tools/zlib --with-ssl-dir=/home/tao/linux/openssh/openssl-3.1.5/install --disable-etc-default-login CC=arm-linux-gnueabihf-gcc AR=arm-linux-gnueabihf-ar
–without-openssl-header-check# 注意修改路径
make
#千万不要 make install 不然会包含一些配置信息
打包
创建文件夹/
srm-ssh,里面创建文件夹sbin,bin,etc,libexec
移植

使用sshd可能报错需要使用绝对地址
/usr/sbin/sshd成功运行,使用finalshell等工具可登陆