ssh 服务安装到arm开发板

目录

一、源码下载

二、编译

1.编译zlib

1.1.zlib的configure

1.2.修改makefile文件

1.3.make;make install

1.4.中间遇到的错误贴图(已经解决)

2.编译openssl

2.1.openssl的configure,make,make install

三、拷贝安装和配置环境

一、源码下载

zlib-1.2.8.tar.gz:zlib下载地址
openssl-0.9.8d.tar.gz:http://www.zlib.net/fossils/

openssh-7.7p1.tar.gz:https://fastly.cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/

下载好以后自己建好路径,解压

二、编译

1.编译zlib

    1.1.zlib的configure

./configure   --prefix=/root/xulei/openssl/install/zlib-1.2.11 

     1.2.修改makefile文件

对应的gcc通通改成你的交叉工具链

1.3.make;make install

1.4.中间遇到的错误贴图(已经解决)

 

 

 

 

2.编译openssl

2.1.openssl的configure,make,make install

 

./Configure --prefix=/home/xulei/openssl/install/openssl-1.0.2o  os/compiler:arm-gcc49-linux-gnueabi-gcc

 

make 

make install

3.编译openssh

./configure --host=arm-histbv320-linux  --with-zlib=/root/xulei/openssl/install/zlib-1.2.11 --with-ssl-dir=/home/xulei/openssl/install/openssl-1.0.2o --disable-etc-default-login --disable-strip CC=arm-gcc49-linux-gnueabi-gcc AR=arm-gcc49-linux-gnueabi-ar

 make

注意:

这一步操作 不要make install

 

三、拷贝安装和配置环境

注意一下文件要拷贝到特定文件下,如果你的开发板根文件系统中没有一下文件,那么需要你自己新建。

(1) 将 openssh目录下的 sshd 拷贝到 目标板的/usr/sbin目录下

(2) 再copy scp sftp ssh ssh-add ssh-agent ssh-keygen ssh-keyscan 到目标板/usr/local/bin目录下
copy sftp-server ssh-keysign 到/usr/local/libexec

(3) 在目标板下: mkdir -p /usr/local/etc/
然后将openssh下的sshd_config,ssh_config 拷贝到该目录下
mkdir -p /var/run; mkdir -p /var/empty/sshd
chmod 755 /var/empty
(4)生成和拷贝pub文件

openssh源码路径下执行操作:

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-keygen -t dsa -f ssh_host_ed25519_key -N ""

将生成的 ssh_host_* 8个文件copy到目标板的 /usr/local/etc/目录下(含有.pub文件)

chmod 700 /usr/local/etc/*

(5).vi /etc/passwd

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

(6) adduser /usr/sbin/sshd(这里我密码为空)

(7)修改sshd_config文件如下选项,其他按默认配置:

cd /usr/local/etc/

vi sshd_config

#HostKey /etc/ssh/ssh_host_rsa_key                                            
#HostKey /etc/ssh/ssh_host_ecdsa_key                                          
#HostKey /etc/ssh/ssh_host_ed25519_key                                        
HostKey /usr/local/etc/ssh_host_ed25519_key                                   
HostKey /usr/local/etc/ssh_host_ecdsa_key                                     
HostKey /usr/local/etc/ssh_host_rsa_key                                       
# Ciphers and keying                                                          
#RekeyLimit default none                                                      
                                                                              
# Logging                                                                     
#SyslogFacility AUTH                                                          
#LogLevel INFO                                                                
                                                                              
# Authentication:                                                             
                                                                              
#LoginGraceTime 2m                                                            
#PermitRootLogin prohibit-password                                            
PermitRootLogin yes       #――允许根用户登陆                                                     
PermitEmptyPasswords   yes   #――允许使用空密码,即不需要密码  

 (8)执行 /usr/sbin/sshd

可以将/usr/sbin/sshd写入/etc/init.d/rcS中开机启动

然后在别的服务器ssh root@开发板IP看看有没有成功

 

 

 之前参考的链接:

https://blog.csdn.net/u013711616/article/details/53044918

 


 

 

 

 

  • 0
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

lei_xu_tenthousand

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值