这篇文章距离最后更新已过71 天,如果文章内容或图片资源失效,请留言反馈,我会及时处理,谢谢!
编译
源码下载
#下载openssh
wget https://mirrors.tuna.tsinghua.edu.cn/pub/OpenBSD/OpenSSH/portable/openssh-6.1p1.tar.gz
#下载zlib
wget https://jaist.dl.sourceforge.net/project/libpng/zlib/1.2.8/zlib-1.2.8.tar.gz
#下载openssl
wget https://github.com/openssl/openssl/releases/download/OpenSSL_1_0_1t/openssl-1.0.1t.tar.gz
zlib编译
#配置
./configure --prefix=install
#配置工具链
CC=arm-v01c02-linux-musleabi-gcc
AR=arm-himix200-linux-ar
CPP =arm-v01c02-linux-musleabi-gcc -E
LDSHARED=arm-v01c02-linux-musleabi-gcc -shared -Wl,-soname,libz.so.1,--version-script,zlib.map
#编译
make -j16
make install
openssl编译
#配置
./Configure --prefix=/home/xuyongxian/open_source/openssl-1.0.1t/install os/compiler:arm-v01c02-linux-musleabi-gcc
#编译
make -j16
make install
openssh编译
#配置
./configure --host=arm-himix200-linux --prefix=/home/xuyongxian/open_source/openssh-6.1p1/install --with-zlib=/home/xuyongxian/open_source/zlib-1.2.8/install --with-ssl-dir=//home/xuyongxian/open_source/openssl-1.0.1t/install --disable-etc-default-login --disable-strip CC=arm-v01c02-linux-musleabi-gcc AR=arm-v01c02-linux-musleabi-ar
#编译
make -j16
make install
运行
拷贝文件到板子上
- 将libz.so库文件放到板子的/lib目录下
- 将ssh-keygen 拷贝到nfs目录下,待会需要执行来生成密钥
- 将sshd拷贝板子的/sbin目录下
- 将sshd_config文件拷贝到/etc目录下
生成密钥文件
#在板子上执行ssh-keygen生成密钥文件
./ssh-keygen -t rsa -f ssh_host_rsa_key -N ""
./ssh-keygen -t dsa -f ssh_host_dsa_key -N ""
#将生成的ssh_host_rsa_key和ssh_host_dsa_key放到板子的/etc目录下
验证SSH有效性
#运行sshd
/sbin/sshd -f /etc/sshd_config -h /etc/ssh_host_rsa_key -h /etc/ssh_host_dsa_key
#没有报错代表启动成功,top可以看到sshd进程在运行
