首页 » 嵌入式笔记 » 正文

openssh arm 编译记录

zlib无压力,照网上编译通过.

编译SSL时照网上坑爹教程,没成功(不要用1.1.x会与opehssh不兼容,使用1.0.1)
.目前的编译参数

./Configure --prefix=$PWD/_install --openssldir=$PWD/_release  linux-armv4 

然后修改 Makefile

CROSS_COMPILE=arm-hisiv200-linux-
make -j8 (嗯,j8)
make install

更新openssl方法

参数:./config no-asm shared --prefix=/home/justchen/sourcecode/openssl --ross-compile-prefix=arm-hisiv300-linux-
生成Makefile后。需要修改makefile,找到有m64的地方,并删除。然后make&&make install

编译 ssh参数

./configure --host=arm-none-linux-gnueabi --with-libs --with-zlib=/home/justchen/nfsdir/library/hisiv200/zlib-1.2.8/_install/ --with-ssl-dir=/home/justchen/nfsdir/library/hisiv200/openssl-1.0.1u/_install/ --disable-etc-default-login CC=arm-hisiv200-linux-gcc AR=arm-hisiv200-linux-ar

然后把zlib文件拷贝到目标板上的/usr/目录中

openssh的
scp sftp sshd ssh ssh-add ssh-agent ssh-keygen ssh-keyscan 拷贝到目标板/usr/bin
moduli ssh_config sshd_config拷贝到目标板 /usr/local/etc
sftp-server ssh-keysign 拷贝到目标板 /usr/local/libexec

然后到目标板 /usr/local/etc 目录下生成ssh key

ssh-keygen -t rsa -f ssh_host_rsa_key
ssh-keygen -t dsa -f ssh_host_dsa_key
ssh-keygen -t ecdsa -f ssh_host_ecdsa_key
ssh-keygen -t ed25519 -f ssh_host_ed25519_key

密码留空就行

修改 sshd_config

PermitRootLogin 项为 yes
Subsystem   sftp    /usr/libexec/sftp-server 改为 /usr/local/libexec

修改 /etc/passwd 文件,在最后加上

sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin

收工

运行 /usr/bin/sshd 就可以了

发表评论