1.编译 ssl
1.1 下载源码
1.2 配置config
./config no-asm -shared --prefix=/sqf/marsopenssh/openssl/ssl_bin/
1.3修改makefile
1.3.1增加
CROSS_COMPILE=mips-linux-gnu-
1.3.2删除
-m64
1.4开始编译
export PATH=$PATH:/sqf/mips-gcc472-glibc216/bin/
make
make install
2.编译zlib
2.1下载zlib源码
2.2编译
export CC=mips-linux-gnu-gcc
export PATH=$PATH:/sqf/mips-gcc472-glibc216/bin/
./configure --prefix=/sqf/marsopenssh/zlib/bin/
make
make install
3.编译openssh
3.1 下载
Index of /pub/OpenBSD/OpenSSH/portable/
3.2编译
export PATH=$PATH:/sqf/mips-gcc472-glibc216/bin/
./configure --host=mips-linux-gnu --prefix=/sqf/marsopenssh/openssh/ssh_bin/ --with-zlib=/sqf/marsopenssh/zlib/bin --with-ssl-dir=/sqf/marsopenssh/openssl/ssl_bin
make
4编译drobear
4.1下载
4.2编译
export PATH=$PATH:/sqf/mips-gcc472-glibc216/bin/
./configure --host=mips-linux-gnu --target=mips-linux-gnu --prefix=/sqf/marsopenssh/dropbear-2019.78/ssh_bin/ --with-zlib=/sqf/marsopenssh/zlib/bin/
make
make install
将生成的 bin(客户端) 和 sbin(服务器端) 目录下的程序复制到设备上
/sbin/dropbear -> /sbin
/bin/dropbearkey -> /bin
生成密钥
创建目录 /etc/dropbear
./dropbearkey -t rsa -f /etc/dropbear/dropbear_rsa_host_key
./dropbearkey -t dss -f /etc/dropbear/dropbear_dss_host_key
./dropbearkey -t ecdsa -f /etc/dropbear/dropbear_ecdsa_host_key
生成密码
pawssd
添加 sftp-server
从编译好的openssh中复制sftp-server 到设备的/usr/libexec目录
将需要的库复制到lib目录下(用了新的ssl的缘故)
-t ecdsa -f /etc/dropbear/dropbear_ecdsa_host_key
dropbear -E
./sftp-server