# 安装依赖
yum -y install zlib-devel
# 下载并解压
cd /tmp
curl -O https://matt.ucc.asn.au/dropbear/dropbear-2024.85.tar.bz2
tar -xf dropbear-2024.85.tar.bz2
# 编译安装
cd dropbear-2024.85
./configure --prefix=/usr/local/dropbear
make && make install
# 生成证书
mkdir /etc/dropbear
/usr/local/dropbear/bin/dropbearkey -t rsa -f /etc/dropbear/dropbear_rsa_host_key
# 修改环境变量
echo 'PATH=/usr/local/dropbear/sbin:$PATH' > /etc/profile.d/dropbear.sh
source /etc/profile.d/dropbear.sh
# 启动,监听2222端口,若启动失败,可加上`-E`参数查看日志
dropbear -p 2222
# 开机启动
echo '/usr/local/dropbear/sbin/dropbear -p 2222' >> /etc/rc.d/rc.local
chmod +x /etc/rc.d/rc.local
centos/redhat编译安装dropbear记录
于 2024-05-14 16:58:31 首次发布