arm sshd交叉编译及部署

资源地址:https://www.openssh.com/portable.html#http

openssh-8.0p1.tar.gz

编译方法

./configure --host=$HOST --prefix=$PREFIX --with-zlib=$PREFIX/../zlib-1.2.11 \
                        --with-ssl=$PREFIX/../openssl-1.1.1b --disable-etc-default-login \
                        --disable-strip --sysconfdir=/usr/local/etc

 

编译完成后将sshd ssh-keygen sftp-server拷贝到板子上,我放的是/usr/local/sbin目录。

sshd 服务器应用程序,ssh-keygen用于生成key

将sshd_config拷贝至编译指定的路径/usr/local/etc。

 

启动sshd提示:

Privilege separation user sshd does not exist 

google了一下,找到了解决方法。 

方法一(推荐): 
修改/etc/passwd文件,在其中加入 
sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin
参考 
http://www.unixguide.net/comments/sun/ssh_installation.shtml/37.shtml 
http://www.gipsky.com/modules/newbb/viewtopic.php?topic_id=966 

方法二(不推荐)openssh-8.0p1已经没有UsePrivilegeSeparation 字段修改无效: 
修改/etc/ssh/sshd_config文件 
将其中 
UsePrivilegeSeparation yes 
修改为 
UsePrivilegeSeparation no 
虽然能解决问题,但是降低了ssh的安全级别。

 

Unable to load host key

Unable to load host key "/usr/local/etc/ssh/ssh_host_ed25519_key": incorrect passphrase supplied to decrypt private key

解决

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 ed25519 -f ssh_host_ed25519_key -N ""

在sshd_config文件中,指明key的位置

 

sshd_config中修改内容还有:

允许root登录

#PermitRootLogin prohibit-password
PermitRootLogin yes

修改sftp-server路径

# override default of no subsystems
Subsystem       sftp    /usr/local/sbin/sftp-server

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值